0

How to follow redirect in grequests ?

In requests library we can simply use : r = requests.get(url, allow_redirects=True) to allow redirect .

is there anything in grequests ?

i have checked https://pypi.org/project/grequests/ but did not found anything.

Pranav Kumar
  • 33
  • 1
  • 5

2 Answers2

0

Just

grequests.get(u, allow_redirects=True)

would do , according to its source code, all parameters are passed to the session.request https://github.com/kennethreitz/grequests/blob/master/grequests.py#L71

Maybe you should try https://github.com/requests/requests-threads

Leo Que
  • 55
  • 1
  • 10
0

Yes, You could follow the same pattern for grequests. If you look at the grequests source code you could see that the send method itself delegating the call to the actual request.Session().request method. This means that you can simply do

rs = grequests.get(u, allow_redirects=True)
Abdul Niyas P M
  • 18,035
  • 2
  • 25
  • 46