Unauthorised after redirect (Authorization header is lost). #1846
Replies: 1 comment 3 replies
-
Ah interesting. Here's how Here's how Lines 524 to 530 in 0b4a832 The difference is that I'm not 100% sure what the best resolution is here, but I think we might well want to allow an exclusion for the (Ideally a pagination API like the one you've described ought to return links with the correct scheme & host in the first place, but the real world is messy, eh...) |
Beta Was this translation helpful? Give feedback.
-
Hi. I'm trying to move my program that uses requests to httpx, but I'm having difficulties with redirects. I'm using the Quora Ads API, and the way its pagination works is that it gives you the URL to the next bit in the response. These URLs come as HTTP, but Quora doesn't accept HTTP; the requests are redirected to HTTPS. If you force the HTTP request, you get a 301. However, it seems that httpx is not sending the Authorization header with the redirected requests, which gives me an Unauthorized error.
This is my function:
This is the output.
This is httpx 0.19.0 on WSL2:
I don't know what request's behaviour is. But this works with the default options there.
Beta Was this translation helpful? Give feedback.
All reactions