M
M
Mister88912016-08-04 15:48:38
Yii
Mister8891, 2016-08-04 15:48:38

When trying to parse XML, GuzzleHttp\Client throws a 302 redirect. How to bypass it?

When trying to parse XML, GuzzleHttp\Client throws a 302 redirect.
Like this
$res = $client->request('GET', ' https://xxxxxxxl ', ['allow_redirects' => true]);
throws another error
GuzzleHttp\Exception\TooManyRedirectsException
Will not follow more than 5 redirects
If allow_redirects' => false then just a 302 redirect and nothing is parsed.
But if you try the usual CURL, everything is fine. I will be grateful for your help!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mister8891, 2016-08-17
@Mister8891

I don't know why GuzzleHttp works the way it does. But with such an error, I only managed to parse with the usual CURl

M
Mikhail Osher, 2016-08-04
@miraage

Set more than 5 redirects.
RTFM .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question