When dealing with
requests we are mostly interested in the content we receive. In this lesson you’ll learn how to access the response content as well as the response meta information stored in the headers.
You can access the content of a response in three different ways and formats. Here is a quick overview about the different ways and formats:
content: This attribute returns the raw bytes of the response content
textattribute returns the content as a normal UTF-8 encoded Python string
json(): You can use the
json()method to get the response content in JSON format
headers attributes returns a Python dictionary with all of the response headers.
Abby Jones on June 25, 2019
I am learning SO much about Python, VIM, and now bpython. RealPython is literally the best site I have ever learned from. It’s increasing my workflow productivity.