The returned response objects contain the redirected url, and I am unable to find the one that I requested for.
How do I find which returned object corresponds to which requested url?
In [31]: urls = [
'http://www.heroku.com',
'http://python-tablib.org',
'http://httpbin.org',
'http://python-requests.org',
'http://kennethreitz.com'
]
In [32]: rs = (grequests.get(u) for u in urls)
In [33]: for i in grequests.imap(rs):
print i, i.url
....:
<Response [200]> https://www.heroku.com/
<Response [200]> http://docs.python-tablib.org/en/latest/
<Response [200]> http://httpbin.org/
<Response [200]> http://docs.python-requests.org/en/latest/
<Response [200]> https://medium.com/@kennethreitz/collections/
neither response.url, nor response.request.url give the requested url.
In [35]: rs = (grequests.get(u) for u in urls)
In [36]: for i in grequests.imap(rs):
print i, i.request.url
....:
<Response [200]> https://www.heroku.com/
<Response [200]> http://docs.python-tablib.org/en/latest/
<Response [200]> http://httpbin.org/
<Response [200]> http://docs.python-requests.org/en/latest/
<Response [200]> https://medium.com/@kennethreitz/collections/
The returned response objects contain the redirected url, and I am unable to find the one that I requested for. How do I find which returned object corresponds to which requested url?
neither response.url, nor response.request.url give the requested url.