Trying to get the raw data of the HTTP response content in requests
in Python. I am interested in forwarding the response through another channel, which means that ideally the content should be as pristine as possible.
What would be a good way to do this?
Thanks very much!
If you are using a
requests.get
call to obtain your HTTP response, you can use theraw
attribute of the response. Here is the code from therequests
docs.After
requests.get()
, you can user.content
to extract the raw Byte-type content.