class documentation

class Request(RequestHooksMixin):

View In Hierarchy

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
methodHTTP method to use.
urlURL to send.
headersdictionary of headers to send.
filesdictionary of {filename: fileobject} files to multipart upload.
datathe body to attach to the request. If a dictionary or list of tuples [(key, value)] is provided, form-encoding will take place.
jsonjson for the body to attach to the request (if files or data is not specified).
paramsURL parameters to append to the URL. If a dictionary or list of tuples [(key, value)] is provided, form-encoding will take place.
authAuth handler or (user, pass) tuple.
cookiesdictionary or CookieJar of cookies to attach to this request.
hooksdictionary 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.
def __init__(self, method=None, url=None, headers=None, files=None, data=None, params=None, auth=None, cookies=None, hooks=None, json=None):

Undocumented

def __repr__(self):

Undocumented

def prepare(self):
Constructs a PreparedRequest for transmission and returns it.
auth =

Undocumented

cookies =

Undocumented

data =

Undocumented

files =

Undocumented

headers =

Undocumented

hooks =

Undocumented

json =

Undocumented

method =

Undocumented

params =

Undocumented

url =

Undocumented