I am using curl and it is working fine in local..but returning

Invalid response line returned from server: HTTP/2 200

in live server.

I referred this link

How to add preference or plugin to overwrite parseHeaders function in vendor/magento/framework/HTTP/Client/Curl.php


Try making like this:

In custom modules di.xml

<?xml version="1.0"?>
   <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
   <preference for="Magento\Framework\View\Element\AbstractBlock"    type="YourCompany\YourModule\Framework\View\Element\AbstractBlock" />
<  /config>

Create your overide file in your custom module.

  • Tried preference like this. But it didn't work. – Pavithra Feb 9 '19 at 5:29

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.