Add `allow_redirects` option to FastHttpSession.request
See original GitHub issueIs your feature request related to a problem? Please describe.
I’m trying to convert my use of HttpLocust to FastHttpLocust, but I am unable to do so because my code critically relies on being able to set allow_redirects
to False.
Describe the solution you’d like
I want an allow_redirects
option supported in FastHttpSession.request such that passing the value True (or not passing a value at all) will automatically perform redirects from a 3xx response and passing the value False will not perform any redirect resulting from a 3xx response.
Describe alternatives you’ve considered
I have considered looking at the Referer/Location that comes back, however I’m unable to inspect the headers after the redirect has been performed. I’m also unable to find the current location after the response has been completed.
Additional context
I need to parse the location URL where the response is saying to redirect.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top GitHub Comments
Since we’re already wrapping the geventhttpclient, I think we could implement support for an
allow_redirects
parameter pretty easily (by setting theredirect_response_codes
).Fixed!