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
I think it's best to use response headers to store this information. I wrote a simple class that saves effective url in X-GUZZLE-EFFECTIVE-URL header:
https://gist.github.com/Thinkscape/43499cfafda1af8f606d
Usage:
push(EffectiveUrlMiddleware::middleware());
$client = new Client(['handler' => $stack]);
// Test it out!
$response = $client->get('http://bit.ly/1N2DZdP');
echo $response->getHeaderLine('X-GUZZLE-EFFECTIVE-URL');