class Request(RequestHooksMixin):
A user-created Request
object.
Used to prepare a PreparedRequest
, which is sent to the server.
Usage:
>>> import requests >>> req = requests.Request('GET', 'https://httpbin.org/get') >>> req.prepare() <PreparedRequest [GET]>
Parameters | |
method | HTTP method to use. |
url | URL to send. |
headers | dictionary of headers to send. |
files | dictionary of {filename: fileobject} files to multipart upload. |
data | the body to attach to the request. If a dictionary or list of tuples [(key, value)] is provided, form-encoding will take place. |
json | json for the body to attach to the request (if files or data is not specified). |
params | URL parameters to append to the URL. If a dictionary or list of tuples [(key, value)] is provided, form-encoding will take place. |
auth | Auth handler or (user, pass) tuple. |
cookies | dictionary or CookieJar of cookies to attach to this request. |
hooks | dictionary of callback hooks, for internal usage. |
Method | __init__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | prepare |
Constructs a PreparedRequest for transmission and returns it. |
Instance Variable | auth |
Undocumented |
Instance Variable | cookies |
Undocumented |
Instance Variable | data |
Undocumented |
Instance Variable | files |
Undocumented |
Instance Variable | headers |
Undocumented |
Instance Variable | hooks |
Undocumented |
Instance Variable | json |
Undocumented |
Instance Variable | method |
Undocumented |
Instance Variable | params |
Undocumented |
Instance Variable | url |
Undocumented |
Inherited from RequestHooksMixin
:
Method | deregister​_hook |
Deregister a previously registered hook. Returns True if the hook existed, False if not. |
Method | register​_hook |
Properly register a hook. |