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

import 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__:

print(response.__dict__)

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


import 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.
🌐
Real Python
realpython.com › python-requests
Python's Requests Library (Guide) – Real Python
July 23, 2025 - You make a GET request in Python using requests.get() with the desired URL. To add headers to requests, pass a dictionary of headers to the headers parameter in your request. To send POST data, use the data parameter for form-encoded data or ...
🌐
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
Run this script to see how the JSON data is parsed into a Python dictionary: ... You should see output that displays information about the GitHub user, including their username, followers count, and repository count. Many APIs return lists of objects. Let's see how to handle this kind of response. Create a file called json_list.py with this content: import requests ## Make a request to an API that returns a list of posts response = requests.get("https://jsonplaceholder.typicode.com/posts") ## Check if the request was successful if response.status_code == 200: ## Parse the JSON response (this w
🌐
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.
🌐
Oxylabs
oxylabs.io › blog › python-requests
Python Requests Library: 2026 Guide
For example, Requests allows you ... to extract data from HTML and XML documents. Essentially, Requests sends requests to a website to get the HTML content, while BeautifulSoup parses the HTML content and extracts the needed ...
🌐
Requests
requests.readthedocs.io › en › latest › api
Developer Interface — Requests 2.34.2 documentation
json – (optional) A JSON serializable Python object to send in the body of the Request. headers – (optional) Dictionary of HTTP Headers to send with the Request. cookies – (optional) Dict or CookieJar object to send with the Request. files – (optional) Dictionary of 'name': file-like-objects (or {'name': file-tuple}) for multipart encoding upload. file-tuple can be a 2-tuple ('filename', fileobj), 3-tuple ('filename', fileobj, 'content_type') or a 4-tuple ('filename', fileobj, 'content_type', custom_headers), where 'content_type' is a string defining the content type of the given file and custom_headers a dict-like object containing additional headers to add for the file.
🌐
W3Schools
w3schools.com › python › ref_requests_get.asp
Python Requests get Method
Python Examples Python Compiler ... Plan Python Interview Q&A Python Bootcamp Python Training ... The get() method sends a GET request to the specified url....
Find elsewhere
🌐
datagy
datagy.io › home › python requests › python requests: get request explained
Python requests: GET Request Explained • datagy
December 30, 2022 - An HTTP GET request is used to retrieve data from the specified resource, such as a website. When using the Python requests library, you can use the .get() function to create a GET request for a specified resource.
🌐
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.
🌐
PyPI
pypi.org › project › requests
requests · PyPI
May 14, 2026 - Python HTTP for Humans. ... Requests is a simple, yet elegant, HTTP library. >>> import requests >>> r = requests.get('https://httpbin.org/basic-auth/user/pass', auth=('user', 'pass')) >>> r.status_code 200 >>> r.headers['content-type'] 'application/json; charset=utf8' >>> r.encoding 'utf-8' >>> r.text '{"authenticated": true, ...' >>> r.json() {'authenticated': True, ...}
      » pip install requests
    
Published   May 14, 2026
Version   2.34.2
🌐
Requests
requests.readthedocs.io › en › latest › user › quickstart
Quickstart — Requests 2.32.5 documentation - Read the Docs
Requests will search for the netrc file at ~/.netrc, ~/_netrc, or at the path specified by the NETRC environment variable. Check details in netrc authentication. Authorization headers will be removed if you get redirected off-host. Proxy-Authorization headers will be overridden by proxy credentials provided in the URL. Content-Length headers will be overridden when we can determine the length of the content.
🌐
Codecademy
codecademy.com › docs › python › requests module › .get()
Python | Requests Module | .get() | Codecademy
May 15, 2024 - The .get() method sends a request for data to a web server. The response object it returns contains various types of data such as the webpage text, status code, and the reason for that response.
🌐
ZetCode
zetcode.com › python › requests
Python Requests - accessing web resources via HTTP
July 20, 2019 - This is a simple HTTP server that returns a JSON response to any GET request. The Content-Type header is set to application/json to indicate that the response body is JSON. The body itself is a JSON-encoded dictionary containing a name and age. ... #!/usr/bin/python import requests url = ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › get-post-requests-using-python
GET and POST Requests Using Python - GeeksforGeeks
July 17, 2025 - The two arguments we pass are URL and the parameters dictionary. ... Now, in order to retrieve the data from the response object, we need to convert the raw response content into a JSON-type data structure.
🌐
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"...'
🌐
ReqBin
reqbin.com › code › python › poyzx88o › python-requests-get-example
How do I send a GET request using Python Requests Library?
GET requests cannot send data to the server in the body of a GET message and cannot change the server's state. If you want to change data on the server, use POST, PUT, PATCH, or DELETE methods. ... After installing the Requests Library, you can use it in your code by importing the Requests Library with the following Python code:
🌐
Fernandomc
fernandomc.com › posts › using-requests-to-get-and-post
Python Requests and Beautiful Soup - Playing with HTTP Requests, HTML Parsing and APIs – Fernando Medina Corey
May 26, 2018 - I just put it there to fix syntax highlighting >>> soup.p.text "I'm Fernando Medina Corey, a data engineer, published course author for software engineering content and an avid punster." Now, these are just a few examples. I’d suggest that you read more about all the other useful features you have access to when using Beautiful Soup too. But now that you understand how you can download website data and interact with it in Python let’s change gears a little and look at how you can use requests to send information back to a website. Requests is good for more than just getting site data.