class documentation

The fully mutable :class:`PreparedRequest <PreparedRequest>` object, containing the exact bytes that will be sent to the server. Instances are generated from a :class:`Request <Request>` object, and should not be instantiated manually; doing so may produce undesirable effects. Usage:: >>> import requests >>> req = requests.Request('GET', 'https://httpbin.org/get') >>> r = req.prepare() >>> r <PreparedRequest [GET]> >>> s = requests.Session() >>> s.send(r) <Response [200]>

Method __init__ Undocumented
Method __repr__ Undocumented
Method copy Undocumented
Method prepare Prepares the entire request with the given parameters.
Method prepare_auth Prepares the given HTTP auth data.
Method prepare_body Prepares the given HTTP body data.
Method prepare_content_length Prepare Content-Length header based on request method and body
Method prepare_cookies Prepares the given HTTP cookie data.
Method prepare_headers Prepares the given HTTP headers.
Method prepare_hooks Prepares the given hooks.
Method prepare_method Prepares the given HTTP method.
Method prepare_url Prepares the given HTTP URL.
Instance Variable body Undocumented
Instance Variable headers Undocumented
Instance Variable hooks Undocumented
Instance Variable method Undocumented
Instance Variable url Undocumented
Static Method _get_idna_encoded_host Undocumented
Instance Variable _body_position Undocumented
Instance Variable _cookies Undocumented

Inherited from RequestEncodingMixin:

Property path_url Build the path URL to use.
Static Method _encode_files Build the body for a multipart/form-data request.
Static Method _encode_params Encode parameters in a piece of data.

Inherited from RequestHooksMixin (via RequestEncodingMixin):

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): (source)

Undocumented

def __repr__(self): (source)

Undocumented

def copy(self): (source)

Undocumented

def prepare(self, method=None, url=None, headers=None, files=None, data=None, params=None, auth=None, cookies=None, hooks=None, json=None): (source)

Prepares the entire request with the given parameters.

def prepare_auth(self, auth, url=''): (source)

Prepares the given HTTP auth data.

def prepare_body(self, data, files, json=None): (source)

Prepares the given HTTP body data.

def prepare_content_length(self, body): (source)

Prepare Content-Length header based on request method and body

def prepare_cookies(self, cookies): (source)

Prepares the given HTTP cookie data. This function eventually generates a ``Cookie`` header from the given cookies using cookielib. Due to cookielib's design, the header will not be regenerated if it already exists, meaning this function can only be called once for the life of the :class:`PreparedRequest <PreparedRequest>` object. Any subsequent calls to ``prepare_cookies`` will have no actual effect, unless the "Cookie" header is removed beforehand.

def prepare_headers(self, headers): (source)

Prepares the given HTTP headers.

def prepare_hooks(self, hooks): (source)

Prepares the given hooks.

def prepare_method(self, method): (source)

Prepares the given HTTP method.

def prepare_url(self, url, params): (source)

Prepares the given HTTP URL.

Undocumented

Undocumented

Undocumented

Undocumented

Undocumented

@staticmethod
def _get_idna_encoded_host(host): (source)

Undocumented

_body_position = (source)

Undocumented

_cookies = (source)

Undocumented