cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to post data to consumer due to an unexpected error

Unable to post data to consumer due to an unexpected error

Hi Magento Community,

 

I installed Magento 2 version to start my e-commerce store, and want to embed my products into my WordPress sites for that I need to activate API in Magento. 

 

But when I click on activate, that error popup.Screenshot_9.png

  

I searched about this but did not found any solution.

 

 

 

2 REPLIES 2

Re: Unable to post data to consumer due to an unexpected error

Could you check your exception.log file to see if this shows any more details on the error, please?

----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!

Re: Unable to post data to consumer due to an unexpected error

The error shared:

 

[2018-01-26 11:40:29] main.CRITICAL: Zend_Http_Client_Exception: Unable to read response, or response is empty in /home/sites/3b/b/bc17aec62d/public_html/vendor/magento/zendframework1/library/Zend/Http/Client.php:1093
Stack trace:
#0 /home/sites/3b/b/bc17aec62d/public_html/vendor/magento/framework/HTTP/ZendClient.php(52): Zend_Http_Client->request('POST')
#1 /home/sites/3b/b/bc17aec62d/public_html/vendor/magento/module-integration/Model/OauthService.php(239): Magento\Framework\HTTP\ZendClient->request('POST')
#2 /home/sites/3b/b/bc17aec62d/public_html/vendor/magento/module-integration/Controller/Adminhtml/Integration/TokensExchange.php(49): Magento\Integration\Model\OauthService->postToConsumer('1', 'https://qumuru....')

 

It occurs on this line: https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/Integration/Model/OauthService...

 

which is the line where Magento is trying to communicate back with the consumer but we are getting an error. What URL did you set up on your application? Are you seeing the request come back in on wordpress? That seems to be where the error is. 

----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!