Closed tedify closed 4 years ago
The body attribute is not directly accessible on AsyncRequest
. However, all keywords are available in the kwargs
attribute. So, you can perhaps extrapolate from that in your exception handler.
>>> req = grequests.get('https://httpbin.org/status/200', data={'foo':'bar'})
>>> req.kwargs
{'data': {'foo': 'bar'}}
On successful requests, you can access the traditional request object through the response attribute.
>>> req = grequests.get('https://httpbin.org/status/200', data={'foo':'bar'})
>>> req.send()
>>> req.response.request.body
'foo=bar'
Hope that helps you out.
Why does it state "Note: You should probably use requests-threads or requests-futures instead." on the readme?
Any particular reason?
@Jack-Lewis1 you can see Kenneth's (the previous owner) comments in #124 for more details, but now that this project is under new ownership, perhaps the readme deserves an update.
Though, this comment seems unrelated to this issue :)
Closing this as there's not been activity on it in a while. Feel free to reopen if more assistance is needed.
For example, I post some random data and I need to know which data was sent with error in exception_handler function, but:
AttributeError: 'AsyncRequest' object has no attribute 'body'