I need to get the URI
from the Response
of GuzzleHTTP
, currently using the getAsync
, and processing the at least 50 items at the same time and needed a way to get the URI
that I use from the guzzle Client
.
$groups->each(function($group) {
$promises = $group->map( function($lead, $index) {
$client = new Client(['http_errors' => false]);
return $client->getAsync($lead->website, [
'timeout' => 5, // Response timeout
'connect_timeout' => 5, // Connection timeout
]);
})->toArray();
settle($promises)->then( function($results) {
$collections = collect($results);
$fulfilled = $collections->where('state', 'fulfilled')->all();
})->wait();
});
it seems like the Request
has this getUri
method but the Response
doesn't and can't find in the interface or class and in the documentation., hope someone can help
Edit: tried getEffectiveUrl
but this only works on Guzzle 5, currently using 6