1

A module I'm maintaining is not working on Magento 2.3 since Magento apparently deprecated Class 'Zend_Rest_Client' . I don't see any replacement Client listed in their documentation, so I'm a bit confused on which class I should be extending now.

This is my class on line 5:

class Client extends \Zend_Rest_Client

This is the error thrown in Magento 2.3:

( ! ) Fatal error: Class 'Zend_Rest_Client' not found in /m23/app/code/Maurisource/Module/Model/Rest/Client.php on line 5

2

You are correct in that Magento deprecated the Zend_Rest module and a bunch of others. You can find a full list here https://devdocs.magento.com/guides/v2.3/release-notes/backward-incompatible-changes/

With replacements, as far as I am aware there is no direct replacement for it.

Instead, if we are trying to modify/extend the client, then we case use the Magento\Framework\HTTP\Client class as the base.

Or if we are trying to use the client to make requests with we can inject one of the following blocks, examples of usage here: https://mage2.pro/t/topic/485

  • \Magento\Framework\HTTP\ZendClient
  • \Magento\Framework\HTTP\Adapter\Curl
  • \Zend_Http_Client

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.