Quantcast
Channel: What is the difference between 'content' and 'text' - Stack Overflow
Browsing latest articles
Browse All 4 View Live

Answer by Akshay Katiha for What is the difference between 'content' and 'text'

To some extent, text is nothing, but a sugar-coated version of content.import requestsresponse = requests.get("https://httpbin.org/get")response.text == response.content.decode(encoding ==...

View Article



Answer by Gary Kerr for What is the difference between 'content' and 'text'

The requests.Response class documentation has more details:r.text is the content of the response in Unicode, and r.content is the content of the response in bytes.

View Article

Answer by PyNEwbie for What is the difference between 'content' and 'text'

It seems clear from the documentation is that r.contentYou can also access the response body as bytes, for non-text requests:>>> r.contentIf you read further down the page it addresses for...

View Article

What is the difference between 'content' and 'text'

I am using the terrific Python Requests library. I notice that the fine documentation has many examples of how to do something without explaining the why. For instance, both r.text and r.content are...

View Article
Browsing latest articles
Browse All 4 View Live




Latest Images