If the response is in json you could do something like (python3):

Copyimport json
import requests as reqs

# Make the HTTP request.
response = reqs.get('https://demo.ckan.org/api/3/action/group_list')

# Use the json module to load CKAN's response into a dictionary.
response_dict = json.loads(response.text)

for i in response_dict:
    print("key: ", i, "val: ", response_dict[i])

To see everything in the response you can use .__dict__:

Copyprint(response.__dict__)

Edit in May 2024 to add a suggestion on how to address if objects in the response dict is not JSON serializable.


Copyimport json
...
print(json.dumps(response.text, indent=4, sort_keys=True, default=lambda o:'<not serializable>'))
Answer from Jortega on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › python › response-content-python-requests
response.content - Python requests - GeeksforGeeks
July 12, 2025 - One of the most important attributes of this object is response.content, which gives you the raw response body in bytes. This is especially useful when dealing with binary data like images, PDFs, audio files, or any non-textual content.
People also ask

When should I use browser automation instead of requests?

Use browser automation tools like Playwright or Selenium when you need to load JavaScript, handle clicks, or when you're blocked by TLS fingerprinting. While these tools solve the TLS problem, they are slower and use more computer resources. ScrapFly offers both simple requests and full browser automation.

🌐
scrapfly.io
scrapfly.io › blog › posts › python-requests-headers-guide
Guide to Python Requests Headers
How do I rotate headers to avoid detection?

Maintain a list of realistic header sets and randomly select one per request. Vary the User-Agent, Accept-Language, and Referer values. Combine this with proxy rotation for better results.

🌐
scrapfly.io
scrapfly.io › blog › posts › python-requests-headers-guide
Guide to Python Requests Headers
Why do my headers work in testing but fail in production?

This is usually because you're sending too many requests. In testing, your low number of requests doesn't trigger extra anti-bot checks. In production, more requests trigger TLS fingerprinting. Even with perfect headers, a different TLS fingerprint will get you blocked. ScrapFly solves this by using real browser TLS profiles.

🌐
scrapfly.io
scrapfly.io › blog › posts › python-requests-headers-guide
Guide to Python Requests Headers
🌐
Requests
requests.readthedocs.io › en › latest › user › quickstart
Quickstart — Requests 2.34.2 documentation
1 month ago - Response.raw is a raw stream of bytes – it does not transform the response content. If you really need access to the bytes as they were returned, use Response.raw. If you’d like to add HTTP headers to a request, simply pass in a dict to the headers parameter.
🌐
W3Schools
w3schools.com › python › module_requests.asp
Python Requests Module
The requests module allows you to send HTTP requests using Python. The HTTP request returns a Response Object with all the response data (content, encoding, status, etc).
🌐
Real Python
realpython.com › python-requests
Python's Requests Library (Guide) – Real Python
July 23, 2025 - To send POST data, use the data parameter for form-encoded data or the json parameter for JSON data. response.text gives you a string representation of the response content, while response.content provides raw bytes.
Find elsewhere
🌐
ProxiesAPI
proxiesapi.com › articles › setting-the-content-type-header-for-python-requests
Setting the Content-Type Header for Python Requests | ProxiesAPI
When sending HTTP requests with the Python Requests library, you can specify headers like Content-Type to indicate the media type of data you are sending to the server.
🌐
ReqBin
reqbin.com › code › python › wr2wzoxh › python-requests-response-example
How do I get the response object in Python Requests?
The Requests Library response object contains all information about the server response, including the status code, version number, headers, and cookies. The Requests Library response object includes the content of the server response, such ...
🌐
Mimo
mimo.org › glossary › python › requests-library
Python requests Library: How to Make HTTP Requests with Python
This code sends a GET request to fetch the webpage content and prints the HTML response. The requests Python library is ideal for working with RESTful APIs.
🌐
W3Schools
w3schools.com › python › ref_requests_response.asp
Python requests.Response Object
Python Examples Python Compiler ... Q&A Python Bootcamp Python Training ... The requests.Response() Object contains the server's response to the HTTP request....
🌐
Scrapfly
scrapfly.io › blog › posts › python-requests-headers-guide
Guide to Python Requests Headers
April 10, 2026 - As shown above, requests automatically converted content-type to the standard Content-Type. This demonstrates that Python’s requests library will normalize header names for you, maintaining compatibility with web servers regardless of the case used in the original code.
🌐
ScrapeOps
scrapeops.io › home › python web scraping playbook › python requests post requests
Python Requests - How to Send POST Requests | ScrapeOps
April 12, 2023 - To send POST requests with Python Requests use the requests.post() method and add the POST body and Content-Type using the body and headers parameters.
🌐
Reddit
reddit.com › r/learnpython › i don't really understand requests python module
r/learnpython on Reddit: I don't really understand Requests python module
July 24, 2022 -

https://www.youtube.com/watch?v=tb8gHvYlCFs&t=374s

I am watching this vid, all excited to learn requests, but I don't really understand nearly anything, like what is r.content doing, or the r.json() function does I also don't get what

what is in r.content, it returns things, but I don't really understand what these things are, r.text returns a dictionary of args, headers, origin etc but I don't really get how this information is useful.

r.get, r.post, or r.put really do I am really sorry for this but if someone could link an article or a little video that explains what the content is, like I am not sure what to search for.

🌐
SQLPad
sqlpad.io › tutorial › python-requests
Python requests - Uncover the power of Python Requests for web communication. Learn HTTP essentials and harness the library for data retrieval, web scraping, and API interaction. - SQLPad.io
When you make an HTTP request using Python's requests library, the server's response is encapsulated in a Response object. This object contains all the information returned by the server and provides methods and attributes to access that data.
🌐
GeeksforGeeks
geeksforgeeks.org › python › response-text-python-requests
response.text - Python requests - GeeksforGeeks
April 15, 2025 - In Python’s requests library, the response.text attribute allows developers to access the content of the response returned by an HTTP request. This content is always returned as a Unicode string, making it easy to read and manipulate.
🌐
Bright Data
brightdata.com › blog › web-data › python-requests-guide
Master Python HTTP Requests: Advanced Guide 2026
April 20, 2026 - The HEAD method is similar to GET, but it only requests the headers of the response, without the actual body content. So, the response returned by the server for a HEAD request will be equivalent to that of a GET request, but with no body data. Use requests.head() to make an HTTP HEAD request in Python:
🌐
GeeksforGeeks
geeksforgeeks.org › python › response-json-python-requests
response.json() - Python requests - GeeksforGeeks
July 12, 2025 - Python requests are generally used to fetch the content from a particular resource URL. Whenever we make a request to a specified URL through Python, it returns a response object.
🌐
ScrapingDog
scrapingdog.com › blog › send-post-python-requests
How To Send A Post Requests in Python?
October 2, 2024 - The Python requests library is commonly used to send POST requests to web servers. Data can be sent in JSON format using the json= parameter or as form data using data=. Setting proper headers like Content-Type is important when submitting ...
🌐
Requests
requests.readthedocs.io
Requests: HTTP for Humans™ — Requests 2.34.2 documentation
Requests is an elegant and simple HTTP library for Python, built for human beings. ... >>> r = requests.get('https://api.github.com/user', auth=('user', 'pass')) >>> r.status_code 200 >>> r.headers['content-type'] 'application/json; charset=utf8' >>> r.encoding 'utf-8' >>> r.text '{"type":"User"...'
🌐
LabEx
labex.io › tutorials › python-how-to-parse-response-content-from-a-python-requests-call-398048
How to parse response content from a Python requests call | LabEx
The Python requests library is a powerful tool for interacting with web services and APIs. In this tutorial, you will learn how to send HTTP requests and parse response data using Python.