New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add functionality to get the final request URL after redirects, like the function urllib2.urlopen().geturl(). #1272
Comments
You cannot: this functionality is not supported at this time. Patches to add it would be welcome. 😄 |
I was investigating this and have a possible solution, but it may make more sense to have this as a utility than to put it off of urlopen. HttpResponse, which is returned by If you try
You will get the following:
This will be empty in the case of no redirects. The following code seems to do what you want:
|
Hey @crwilcox could you turn that into a method of Response? I'd gladly accept that change. :) |
@SethMichaelLarson sure. feel free to assign this to me and I can probably do it Friday :) |
Consider yourself officially assigned! (GitHub isn't letting me assign non-collaborators?) |
@SethMichaelLarson, |
If you've got time I'd still like to see a PR for this functionality even if it adds a field to response objects. It's genuinely useful functionality we're missing compared to httplib. |
Implements #1272 by adding a geturl method to HTTPResponse objects
Closed by #1382 |
Implements urllib3#1272 by adding a geturl method to HTTPResponse objects
No description provided.
The text was updated successfully, but these errors were encountered: