Questions tagged [guzzle6]
337 questions
7
votes
1 answer
Access the response for rejected concurrent requests in Guzzle
I am using Guzzle concurrency request tool:
http://docs.guzzlephp.org/en/latest/quickstart.html#concurrent-requests
My code is similar to the example code:
use GuzzleHttp\Pool;
use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Request;
$client = new…

Yahya Uddin
- 26,997
- 35
- 140
- 231
7
votes
1 answer
How do I profile Guzzle 6 requests?
I'm trying to profile the requests made to an API server from a PHP client using Guzzle (v 6).
In the Guzzle 5.3 there is this complete and before event handling.
class GuzzleProfiler implements SubscriberInterface
{
public function…

Petra Barus
- 3,815
- 8
- 48
- 87
6
votes
3 answers
Guzzle disabling certificate verification to false, how insecure is it?
Recently I found myself working with Guzzle while making requests to another server to post and fetch some data, in some cases, tokens. But I was getting certificate invalid error and I even tried to get a new .pem certificate, but Guzzle was still…

Rohan
- 13,308
- 21
- 81
- 154
6
votes
1 answer
How to get the query parameters in a Guzzle/ Psr7 request
I am using Guzzle 6.
I am trying to mock a client and use it like so:

Yahya Uddin
- 26,997
- 35
- 140
- 231
6
votes
4 answers
How do I configure default query parameters with Guzzle 6?
Migrating from 5 to 6, and I've run into a snag and can't find the relevant docs.
Guzzle docs here, http://guzzle.readthedocs.io/en/latest/quickstart.html#creating-a-client, site that we can add "any number of default request options".
I want to…

Saeven
- 2,280
- 1
- 20
- 33
6
votes
2 answers
What's the correct way to use Guzzle 6 to create pool of asynchronous json requests to send to API endpoints?
My objective is to use Guzzle 6 to create a pool of asynchronous requests that PUT json data. Then monitor each $promise success/failure.
For comparison to my POOL code example, the following single request to $client->request() converts the 3rd…

Zelf
- 1,723
- 2
- 23
- 40
6
votes
2 answers
How to make a Guzzle post using query string parameters
In a Google Oauth2 implementation I'm trying to exchange an authorization code for tokens using a guzzle call.
The following guzzle call works fine and returns the expected values:
$result = $this->client->post(
…

rfc1484
- 9,441
- 16
- 72
- 123
6
votes
1 answer
Attaching OAuth1 to GuzzleHttp\Client
I'm trying to upgrade a class to use GuzzleHttp\Client to search tweets using twitter api. I'm having trouble attaching Oauth1. It worked fine with Guzzle3 and OAuthPlugin.
Here is the code block:
$client = new Client(['base_uri' =>…

mishka
- 677
- 6
- 20
5
votes
4 answers
How to send files with Guzzle without loading them into memory
I have a form where I can upload multiple files to my laravel backend and I wand to send all those files with Guzzle to external API
I'm having an issue where my script is running out of memory if I upload more MB that what memory is available.…

ljubadr
- 2,174
- 1
- 20
- 24
5
votes
2 answers
GuzzleHttp \ Exception \ ConnectException cURL error 7: Failed to connect to localhost port 8088: Connection refused
I'm using laradock and I can access the page in browser http://localhost:8088/api/getakicks/get without any problems.
But when I try to access it in controller I'm getting this error:
GuzzleHttp \ Exception \ ConnectException cURL error 7: Failed…

whitesiroi
- 2,725
- 4
- 30
- 64
5
votes
0 answers
How to close the request after its complete using Guzzle 6.x Client
I have a task to identify the existence of the links. As a result I am using guzzle client to identify if the link is existence or not, i.e if the response header received is 200, then the link is existence else not.
Below is my code snippet
public…

Krish Damani
- 185
- 2
- 14
5
votes
8 answers
Guzzle post multipart request with nested array
After a long day of debugging and try and error tries searching for a good method with Guzzle6 post with nested array and resource items.
I've found on Guzzle6 documentation that data need to be post with ['multipart' => []]. This works when i got…

Danny Bevers
- 831
- 1
- 8
- 16
5
votes
2 answers
Response logging in AWS PHP SDK v3
In v2 of the AWS PHP SDK, I was able to setup logging of request and response information by simply doing this:

jmar
- 452
- 2
- 14
4
votes
1 answer
Symfony 3.4 - Transfert API stream file to client download
An API sends me a stream containing a zip archive of several files that I choose by providing their ids in the parameter SelectedIds of my request.
I receive a PSR7 response that I pass to HttpFoundationFactory to return a Response that corresponds…

arno
- 792
- 14
- 33
4
votes
1 answer
Guzzle is sending requests synchronously
I am using Guzzle to consume a SOAP API. I have to make 6 requests, but in the future this might be even an indeterminate amount of requests.
Problem is that the requests are being send sync, instead of async. Every request on it's own takes +-2.5s.…

nicktc
- 93
- 1
- 7