Generally speaking you can introspect Python objects with the dir() and vars() functions:

>>> import requests
>>> response = requests.get('http://httpbin.org/get?foo=bar')
>>> dir(response)
['__attrs__', '__bool__', '__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__getstate__', '__hash__', '__init__', '__iter__', '__module__', '__new__', '__nonzero__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setstate__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_content', '_content_consumed', 'apparent_encoding', 'close', 'connection', 'content', 'cookies', 'elapsed', 'encoding', 'headers', 'history', 'is_permanent_redirect', 'is_redirect', 'iter_content', 'iter_lines', 'json', 'links', 'ok', 'raise_for_status', 'raw', 'reason', 'request', 'status_code', 'text', 'url']
>>> 'url' in dir(response)
True
>>> vars(response).keys()
['cookies', '_content', 'headers', 'url', 'status_code', '_content_consumed', 'encoding', 'request', 'connection', 'elapsed', 'raw', 'reason', 'history']

You could also just use the help() function and Python will format the docstrings on a class; response.url doesn't have a docstring but is listed in the attributes section.

For requests specifically, just check out the excellent API documentation. The url attribute is listed as part of the Response object.

Answer from Martijn Pieters on Stack Overflow
๐ŸŒ
Requests
requests.readthedocs.io โ€บ en โ€บ latest โ€บ api
Developer Interface โ€” Requests 2.34.2 documentation
data โ€“ (optional) Dictionary, list of tuples, bytes, or file-like object to send in the body of the Request. json โ€“ (optional) A JSON serializable Python object to send in the body of the Request.
๐ŸŒ
W3Schools
w3schools.com โ€บ PYTHON โ€บ ref_requests_response.asp
Python requests.Response Object
Python Examples Python Compiler ... Python Bootcamp Python Training ... The requests.Response() Object contains the server's response to the HTTP request....
Top answer
1 of 2
15

Generally speaking you can introspect Python objects with the dir() and vars() functions:

>>> import requests
>>> response = requests.get('http://httpbin.org/get?foo=bar')
>>> dir(response)
['__attrs__', '__bool__', '__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__getstate__', '__hash__', '__init__', '__iter__', '__module__', '__new__', '__nonzero__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setstate__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_content', '_content_consumed', 'apparent_encoding', 'close', 'connection', 'content', 'cookies', 'elapsed', 'encoding', 'headers', 'history', 'is_permanent_redirect', 'is_redirect', 'iter_content', 'iter_lines', 'json', 'links', 'ok', 'raise_for_status', 'raw', 'reason', 'request', 'status_code', 'text', 'url']
>>> 'url' in dir(response)
True
>>> vars(response).keys()
['cookies', '_content', 'headers', 'url', 'status_code', '_content_consumed', 'encoding', 'request', 'connection', 'elapsed', 'raw', 'reason', 'history']

You could also just use the help() function and Python will format the docstrings on a class; response.url doesn't have a docstring but is listed in the attributes section.

For requests specifically, just check out the excellent API documentation. The url attribute is listed as part of the Response object.

2 of 2
2

Use dir() in the shell:

>>> import requests
>>> req = requests.get('http://www.google.com')
>>> dir(req)
['__attrs__', '__bool__', '__class__', '__delattr__', '__dict__', '__doc__',
'__format__', '__getattribute__', '__getstate__', '__hash__', '__init__',
'__iter__', '__module__', '__new__', '__nonzero__', '__reduce__',
'__reduce_ex__', '__repr__', '__setattr__', '__setstate__', '__sizeof__',
'__str__', '__subclasshook__', '__weakref__', '_content', '_content_consumed',
'apparent_encoding', 'close', 'connection', 'content', 'cookies', 'elapsed', 
'encoding', 'headers', 'history', 'is_redirect', 'iter_content', 'iter_lines',
'json', 'links', 'ok', 'raise_for_status', 'raw', 'reason', 'request',
'status_code', 'text', 'url']
๐ŸŒ
Requests
requests.readthedocs.io โ€บ en โ€บ latest โ€บ user โ€บ quickstart
Quickstart โ€” Requests 2.34.2 documentation
1 month ago - Requests is an elegant and simple HTTP library for Python, built for human beings.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ response-methods-python-requests
Response Methods - Python requests - GeeksforGeeks
July 12, 2025 - When one makes a request to a URI, it returns a response. This Response object in terms of python is returned by requests.method(), method being - get, post, put, etc. Response is a powerful object with lots of functions and attributes that ...
๐ŸŒ
Python
docs.python.org โ€บ 3 โ€บ library โ€บ urllib.request.html
urllib.request โ€” Extensible library for opening URLs
This class is an abstraction of a URL request. url should be a string containing a valid, properly encoded URL. data must be an object specifying additional data to send to the server, or None if no such data is needed. Currently HTTP requests are the only ones that use data.
๐ŸŒ
Real Python
realpython.com โ€บ python-requests
Python's Requests Library (Guide) โ€“ Real Python
July 23, 2025 - The type of the return value of .json() is a dictionary, so you can access values in the object by key: ... You can do a lot with status codes and message bodies. But if you need more information, like metadata about the response itself, youโ€™ll need to look at the responseโ€™s headers. The response headers can give you useful information, such as the content type of the response payload and how long to cache the response. To view these headers, access .headers: ... >>> import requests >>> response = requests.get("https://api.github.com") >>> response.headers {'Server': 'github.com', ...
Find elsewhere
๐ŸŒ
Todoist
developer.todoist.com โ€บ api โ€บ v1
Todoist API
When the request succeeds, an HTTP 200 response will be returned with a JSON object containing the requested resources and a new sync_token.
๐ŸŒ
Zoom
developers.zoom.us โ€บ docs โ€บ api
API Reference - API - Zoom Developer Docs
Send HTTP requests to the base URL https://api.zoom.us/v2/ with your access token in the Authorization header. Use GET, POST, PATCH, PUT, or DELETE methods as needed for different endpoints.
๐ŸŒ
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 ...
๐ŸŒ
Twelve Data
twelvedata.com โ€บ docs
API Documentation - Twelve Data
This key is required to authenticate all API and WebSocket requests. Try a simple API call with cURL to fetch the latest price for Apple (AAPL): curl "https://api.twelvedata.com/price?symbol=AAPL&apikey=your_api_key" Use our client libraries or standard HTTP clients to make API calls programmatically. Hereโ€™s an example in Python and Node.js:
๐ŸŒ
Python Requests
python-requests.org โ€บ home
Mastering HTTP Requests in Python: A Complete Guide to the Requests Library -
November 7, 2025 - The requests library is a Python package designed to make HTTP requests more human-friendly. It was created to simplify tasks that were traditionally complex when using Pythonโ€™s built-in modules like urllib or http.client.
๐ŸŒ
Apify
docs.apify.com โ€บ api โ€บ v2
Apify API | Apify Documentation
All requests and responses (including errors) are encoded in JSON format with UTF-8 encoding, with a few exceptions that are explicitly described in the reference. To access the API using Node.js, we recommend the apify-client NPM package. To access the API using Python, we recommend the apify-client PyPI package.
๐ŸŒ
DEV Community
dev.to โ€บ bl4ckst0n3 โ€บ requests-module-in-python-how-to-use-requests-in-python--3gmh
Requests module in Python: ๐Ÿ“ญ How to use requests in Python ? - DEV Community
November 1, 2021 - That's it! Now we are ready to use requests. ๐Ÿ›  Let's take a look at what we are able to do using requests. One of the most two common HTTP methods GET is used for reach out the data from specific resource. Python provides us get() method that takes data resource as argument in requests module.
๐ŸŒ
Playwright
playwright.dev โ€บ api testing
API testing | Playwright
APIRequestContext can send all kinds of HTTP(S) requests over network.
๐ŸŒ
Python-requests
fr.python-requests.org โ€บ en โ€บ latest โ€บ api.html
API โ€” Requests 0.13.9 documentation
Constructs and sends a Request. Returns Response object. Requests is an elegant and simple HTTP library for Python, built for human beings.
๐ŸŒ
Pydantic
pydantic.dev โ€บ docs โ€บ validation โ€บ latest โ€บ concepts โ€บ models
Models | Pydantic Docs
Pydantic can validate data in three different modes: Python, JSON and strings. ... The __init__() model constructor. Field values must be provided using keyword arguments. model_validate(): data can be provided either as a dictionary, or as a model instance (by default, instances are assumed to be valid; see the revalidate_instances setting). Arbitrary objects can also be provided if explicitly enabled.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-requests-tutorial
Python Requests - GeeksforGeeks
July 31, 2025 - For more visit- SSL Certificate Verification โ€“ Python requests ยท Session objects allow you to persist settings across multiple requests, such as headers, cookies, and connection pooling.
๐ŸŒ
Flask
flask.palletsprojects.com โ€บ en โ€บ stable โ€บ api
API โ€” Flask Documentation (3.1.x)
The flask object implements a WSGI application and acts as the central object. It is passed the name of the module or package of the application. Once it is created it will act as a central registry for the view functions, the URL rules, template configuration and much more. The name of the package is used to resolve resources from inside the package or the folder the module is contained in depending on if the package parameter resolves to an actual python package (a folder with an __init__.py file inside) or a standard module (just a .py file).