Convert PHP HTTP request to Guzzle

I currently have an old PHP page which carries out a post request to an external API but i am wanting to convert this to Guzzle to tidy it up but im not sure if im on the right lines with this. PHP …

“file_get_contents(http://127.0.0.1:8000/storage/config/xxx.ini): failed to open stream: HTTP request failed! ”

I got this error message when trying to send form data post request via POST method. “file_get_contents(http://127.0.0.1:8000/storage/config/xxx.ini): failed to open stream: HTTP request failed! ” …

What is the correct way to read a large JSON API response in Guzzle 6?

I currently have the following Guzzle 6 implementation returning a stream of JSON data containing user data: $client = new GuzzleHttpClient([ ‘base_uri’ => ‘https://www.apiexample.com’, …

How can I get response from guzzle in Laravel 5.3

I try like this : $client = new Client(); $res = $client->request(‘POST’, ‘https://api.orange.com/smsmessaging/v1/outbound/tel:+phone/requests/’, [ ‘headers’ => [ ‘…

Swagger basic authentication fails with php client

When I try to use the generated php client from a yaml file it doesn’t seem to work. I get a authentication error even though I had filled in the configuration for the authentication. But when I …

Issues instantiating class in composition project

So I have a task to access an external api and then render the results to a separate FE. I have made an ApiClass and a ProductListClass. Then from an index page I am including the two class files and …

What’s the equivalent of GuzzleHttpEventSubscriberInterface in Guzzle 6?

In Guzzle 5.3 you can use event subscribers as in the following example: use GuzzleHttpEventEmitterInterface; use GuzzleHttpEventSubscriberInterface; use GuzzleHttpEventBeforeEvent; use …

Can you include raw JSON in Guzzle POST Body?

This should be soo simple but I have spent hours searching for the answer and am truly stuck. I am building a basic Laravel application and am using Guzzle to replace the CURL request I am making at …