2

I need to make cURL requests within my Magento 2 instance to an external source. As far as I can see there are 3 options

  1. Use native PHP
  2. Use Magento\Framework\HTTP\Adapter\Curl which uses Zend
  3. Use Magento\Framework\HTTP\Client\Curl which uses Magento framework

Please could anyone advise of any advantages and which one I should ideally use

1
  1. Use native PHP: not recommended, can build our own class for the reusable purpose. And add more advanced features if we want.

  2. Currently, my Magento version is 2.2.0 is still using Zend version 1 . It doesn't support: https://framework.zend.com/long-term-support.

  3. For a simple work, should use a built-in class Magento\Framework\HTTP\Client\Curl.

  • If we use the 3rd option then how can we use PUT method? I am searching a lot but not getting an exact way to use the PUT method – Deepak Shinde Mar 27 '19 at 12:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.