question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add `allow_redirects` option to FastHttpSession.request

See original GitHub issue

Is 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:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
heymancommented, Jan 24, 2020

Since we’re already wrapping the geventhttpclient, I think we could implement support for an allow_redirects parameter pretty easily (by setting the redirect_response_codes).

0reactions
cyberwcommented, Apr 20, 2020

Fixed!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Increase performance with a faster HTTP client
Describes number of concurrent requests allowed by the FastHttpSession. Default 10. Note that setting this value has no effect when custom client_pool was...
Read more >
Is there an easy way to request a URL in python and NOT ...
Here is the Requests way: import requests r = requests.get('http://github.com', allow_redirects=False) print(r.status_code, r.headers['Location']).
Read more >
Advanced Usage — Requests 2.28.1 documentation
The Session object allows you to persist certain parameters across requests. It also persists cookies across all requests made from the Session instance, ......
Read more >
Python Requests | Redirection - YouTube
With the Requests library, location redirection can be controlled through a simple keyword. By default, location redirection using the ...
Read more >
Using fasthttp to make API requests in Golang - David Bacisin
Need to make HTTP requests from a Go application? David Bacisin evaluates the usability and performance of fasthttp as an alternative to the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found