3. Request

3.1. Synopsis

>>> from http import Request
>>> request = Request('GET', 'http://pypi.python.org')

3.2. Interface

Request instances have the following methods:

class http.request.Request

The Request object encapsulates HTTP style requests

header(name, value=None)

Returns the value of the given header

Return type:string
headers

Returns the Headers used for the request

Return type:class:Headers
if_modified_since

Returns a datetime object representing the value of the “If-Modified-Since” header

Return type:class:datetime
if_unmodified_since

Returns a datetime object representing the value of the “If-Unmodified-Since” header

Return type:class:datetime
method

Returns the HTTP method

Return type:string