How to get the raw content of a response in requests with Python?

前端 未结 3 1048
北恋
北恋 2020-12-09 09:25

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 t

3条回答
  •  [愿得一人]
    2020-12-09 09:31

    After requests.get(), you can use r.content to extract the raw Byte-type content.

    r = requests.get('https://yourweb.com', stream=True)
    r.content
    

提交回复
热议问题