cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP ClientInterface does not allow sending of raw body data

0 Kudos

HTTP ClientInterface does not allow sending of raw body data

Feature request from navarr, posted on GitHub Jul 21, 2016

Steps to reproduce

  1. Install Magento from develop branch.
  2. Begin writing code that interacts with an API that takes, for example, JSON as the body request
  3. Investigate the \Magento\Framework\HTTP\ClientInterface to see how to send this body within the Magento framework

Expected result

  1. post method, or another method allows the sending of raw json or other raw data to the server

Actual result

  1. No such functionality exists, making it impossible to send raw data over the HTTP ClientInterface

As a potential fix, I've opened Pull Request #5407. This enables the post method to send raw data as well as the previously accepted array of data.

4 Comments
apiuser
New Member

Comment from adragus-inviqa, posted on GitHub Jul 21, 2016

I still don't know why they haven't settled for a 3rd party (Guzzle et al). Too many, maybe?

apiuser
New Member

Comment from navarr, posted on GitHub Jul 21, 2016

@adragus-inviqa You probably wouldn't want a 3rd party as the Interface. Using PSR-7 perhaps - but it'd take some pretty rough refactoring, I imagine.

apiuser
New Member

Comment from adragus-inviqa, posted on GitHub Jul 21, 2016

Didn't meant as an interface, but yeah, I forgot about PSR7. That's a no-go, indeed.

apiuser
New Member

Comment from stamster, posted on GitHub Jul 21, 2016

Another very basic function missing. On Magento 1.x, anyone has idea whenever this was possible? I can bet it was.