How to get the url of all redirects using HttpClient?
Here is an example:
- http://example.com/page 301 redirects to:
- http://www.example.com/page 302 redirects to:
- http://www.example.com/page/
$response = $this->httpClient->request('GET', 'http://example.com/page');
$content = $response->getContent(false);
$ary = $response->getInfo();
Only in the '[debug]' part of the getInfo I can see:
Issue another request to this URL: 'http://www.example.com/page'
...
Issue another request to this URL: 'http://www.example.com/page/'
Is there a way to retrieve the URLs of the redirects without parsing the debug text?