I\'ve been searching for about 2 hours and I can\'t figure it out how to read the final response uri.
In previous versions of PHP Guzzle you just call
Guzzle 6.1 solution right from the docs.
use GuzzleHttp\Client;
use GuzzleHttp\TransferStats;
$client = new Client;
$client->get('http://some.site.com', [
'query' => ['get' => 'params'],
'on_stats' => function (TransferStats $stats) use (&$url) {
$url = $stats->getEffectiveUri();
}
])->getBody()->getContents();
echo $url; // http://some.site.com?get=params