1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-03-14 19:29:49 +01:00

Fix error on quickstart for concurrent requests (#2574)

The example fixed gives an error as it is at the moment:

`Fatal error: Uncaught Error: Call to a member function getHeader() on array`

The fix provides the right code for the example.
This commit is contained in:
Juan Morales 2020-05-18 19:30:09 +02:00 committed by GitHub
parent 223b0fe5ef
commit 837b5a3554
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -192,8 +192,8 @@ requests.
$responses = Promise\settle($promises)->wait();
// You can access each response using the key of the promise
echo $responses['image']->getHeader('Content-Length')[0];
echo $responses['png']->getHeader('Content-Length')[0];
echo $responses['image']['value']->getHeader('Content-Length')[0];
echo $responses['png']['value']->getHeader('Content-Length')[0];
You can use the ``GuzzleHttp\Pool`` object when you have an indeterminate
amount of requests you wish to send.