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
🌐
ReqBin
reqbin.com › code › python › wr2wzoxh › python-requests-response-example
How do I get the response object in Python Requests?
Working with Response Object of Python Requests Library Execute · import requests response = requests.get('https://reqbin.com/echo/get/json') print(f'Status Code: {response.status_code}')
🌐
W3Schools
w3schools.com › python › ref_requests_response.asp
Python requests.Response Object
Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Practice Problems Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Training ... The requests.Response() Object contains the server's response to the HTTP request.
Discussions

http - how to get response data from a python post request - Stack Overflow
I have an openapi3 server running that I'm trying to authenticate with. I can do it with curl with no problems curl -k -X POST "https://localhost:8787/api/login/user" -H "accept: More on stackoverflow.com
🌐 stackoverflow.com
How to get a response body from a http request
pip install requests, then requests.get(url).text is the body of the response. (url is your string, the rest is literal). More on reddit.com
🌐 r/Python
4
1
November 26, 2015
How can I speed up python requests?
You could try https://requests.readthedocs.io/en/master/user/advanced/ More on reddit.com
🌐 r/learnpython
13
5
August 14, 2022
How to get a response to a request in python?

Please Add A Flair To Your Post!

Suggested Flair: [Other Code]

 

To add a flair:

  • Click flair underneath your post

  • Select a flair

  • Click save

 

I am a bot run by /u/SupremeDesigner for r/CodingHelp || This was an automated ^response

More on reddit.com
🌐 r/CodingHelp
4
2
January 6, 2020
🌐
GeeksforGeeks
geeksforgeeks.org › python › response-methods-python-requests
Response Methods - Python requests - GeeksforGeeks
July 12, 2025 - ... # import requests module import requests # Making a get request response = requests.get('https://api.github.com///') # print response print(response) # print json content print(response.json())
🌐
Requests
requests.readthedocs.io › en › latest › user › quickstart
Quickstart — Requests 2.34.2 documentation
1 month ago - If you were constructing the URL by hand, this data would be given as key/value pairs in the URL after a question mark, e.g. httpbin.org/get?key=val. Requests allows you to provide these arguments as a dictionary of strings, using the params keyword argument. As an example, if you wanted to pass key1=value1 and key2=value2 to httpbin.org/get, you would use the following code:
🌐
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 the json parameter for JSON data. response.text gives you a string representation of the response content, while response.content provides raw bytes.
🌐
Codecademy
codecademy.com › docs › python › requests module › .get()
Python | Requests Module | .get() | Codecademy
May 15, 2024 - The .get() method sends a GET request ... a response object. ... Learn to analyze and visualize data using Python and statistics. ... Learn the basics of Python 3.12, one of the most powerful, versatile, and in-demand programming languages today. ... **kwargs are any number of dictionary items (named arguments) that are passed in as parameters. Many different named parameters can be passed into a GET request. For example, they can ...
Find elsewhere
🌐
CodeSignal
codesignal.com › learn › courses › basics-of-http-requests-with-python › lessons › making-get-requests-and-handling-responses-1
Making GET Requests and Handling Responses
Let's dive into the process of ... using Python's requests library. Our goal is to retrieve a list of to-do items from the /todos endpoint using the GET method. By using the requests.get() method, we send a GET request to the constructed full URL. The response from the server, stored in the variable response, is then printed using response.text, which gives us the raw response body as a string. Here’s an example of what the ...
🌐
Scaler
scaler.com › home › topics › python responses
Python Responses - Scaler Topics
May 4, 2023 - The Python Response method aids us with multiple features, functionalities, and methods. For example, In the given case below, the response.status_code will return the header's status code thus allowing us to check the success or failure status of the processed request.
🌐
PyPI
pypi.org › project › responses
responses · PyPI
However, you can see, that status ...try=OrderedRegistry) def test_invocation_index(): responses.get( "http://twitter.com/api/1/foobar", json={"msg": "not found"}, status=404, ) responses.get( "http://twitter.com/api/1/foobar", ...
      » pip install responses
    
Published   May 21, 2026
Version   0.26.1
🌐
Mimo
mimo.org › glossary › python › requests-library
Mimo: The coding platform you need to learn Web Development, Python, and more.
The requests Python library is ideal for working with RESTful APIs. The library allows you to send and receive JSON data from APIs without much effort. ... import requests api_url = '<https://api.example.com/users/123>' response = requests.get(api_url) data = response.json() print(data)
🌐
Nylas
nylas.com › developer how-tos › how to use the python requests module with rest apis
How to Use the Python Requests Module With REST APIs | Nylas
June 5, 2024 - The GET method is used to access ... a function to do exactly this. import requests response = requests.get("http://api.open-notify.org/astros.json") print(response) >>>> Response<200> The response object contains all the ...
🌐
W3Schools
w3schools.com › python › ref_requests_get.asp
Python Requests get Method
Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Practice Problems Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Training ... The get() method sends a GET request to the specified url. ... The get() method returns a requests.Response object.
🌐
GeeksforGeeks
geeksforgeeks.org › python › response-text-python-requests
response.text - Python requests - GeeksforGeeks
April 15, 2025 - Whether the response body contains ... it. Example: ... import requests # Send a GET request r = requests.get('https://jsonplaceholder.typicode.com/posts/1') print(r.text)...
🌐
Python
docs.python.org › 3 › library › http.client.html
http.client — HTTP protocol client — Python 3.14.6 ...
Raised by HTTPConnection.getresponse() when the attempt to read the response results in no data read from the connection, indicating that the remote end has closed the connection. Added in version 3.5: Previously, BadStatusLine('') was raised. ... The default port for the HTTP protocol (always 80). ... The default port for the HTTPS protocol (always 443). ... This dictionary maps the HTTP 1.1 status codes to the W3C names. Example: http.client.responses[http.client.NOT_FOUND] is 'Not Found'.
🌐
GitHub
github.com › getsentry › responses
GitHub - getsentry/responses: A utility for mocking out the Python Requests library. · GitHub
However, you can see, that status ...try=OrderedRegistry) def test_invocation_index(): responses.get( "http://twitter.com/api/1/foobar", json={"msg": "not found"}, status=404, ) responses.get( "http://twitter.com/api/1/foobar", ...
Starred by 4.3K users
Forked by 365 users
Languages   Python
🌐
Oxylabs
oxylabs.io › blog › python-requests
Python Requests Library: 2026 Guide
In the preceding example, we define ... using the headers argument. The get() method. If the request is successful (a 200 status code is given), we use the response.json() function to convert the JSON data returned by the ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › response-content-python-requests
response.content - Python requests - GeeksforGeeks
July 12, 2025 - Download and save an image from a URL using response.content: ... import requests img_url = 'https://picsum.photos/id/237/200/300' res = requests.get(img_url) with open('sample_image.png', 'wb') as f: f.write(res.content)
🌐
IONOS
ionos.com › digital guide › websites › web development › python requests module
How to send HTTP requests with Python - IONOS
June 27, 2025 - For this, use the following code: import requests response = requests.post("https://example.com", json={"key": "value"}) print(response.request.headers["content-type"]) print(response.request.url) print(response.request.body)python