| |
- __builtin__.object
-
- HttpClient
- HttpRequest
- HttpResponse
- Uri
- exceptions.Exception(exceptions.BaseException)
-
- Error
-
- UnknownSize
class HttpClient(__builtin__.object) |
|
Performs HTTP requests using httplib. |
|
Methods defined here:
- Request = request(self, http_request)
- request(self, http_request)
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes defined here:
- debug = None
|
class HttpRequest(__builtin__.object) |
|
Contains all of the parameters for an HTTP 1.1 request.
The HTTP headers are represented by a dictionary, and it is the
responsibility of the user to ensure that duplicate field names are combined
into one header value according to the rules in section 4.2 of RFC 2616. |
|
Methods defined here:
- AddBodyPart = add_body_part(self, data, mime_type, size=None)
- AddFormInputs = add_form_inputs(self, form_data, mime_type='application/x-www-form-urlencoded')
- __init__(self, scheme=None, host=None, port=None, method=None, uri=None, headers=None)
- Construct an HTTP request.
Args:
scheme: str The protocol to be used, usually this is 'http' or 'https'
host: str The name or IP address string of the server.
port: int The port number to connect to on the server.
method: The HTTP method for the request, examples include 'GET', 'POST',
etc.
uri: str The relative path inclusing escaped query parameters.
headers: dict of strings The HTTP headers to include in the request.
- add_body_part(self, data, mime_type, size=None)
- Adds data to the HTTP request body.
If more than one part is added, this is assumed to be a mime-multipart
request. This method is designed to create MIME 1.0 requests as specified
in RFC 1341.
Args:
data: str or a file-like object containing a part of the request body.
mime_type: str The MIME type describing the data
size: int Required if the data is a file like object. If the data is a
string, the size is calculated so this parameter is ignored.
- add_form_inputs(self, form_data, mime_type='application/x-www-form-urlencoded')
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes defined here:
- host = None
- method = None
- port = None
- scheme = None
- uri = None
|
class HttpResponse(__builtin__.object) |
| |
Methods defined here:
- __init__(self, status=None, reason=None, headers=None, body=None)
- getheader(self, name, default=None)
- read(self, amt=None)
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes defined here:
- reason = None
- status = None
|
class Uri(__builtin__.object) |
|
A URI as used in HTTP 1.1 |
|
Methods defined here:
- ModifyRequest = modify_request(self, http_request=None)
- __init__(self, scheme=None, host=None, port=None, path=None, query=None)
- Constructor for a URI.
Args:
scheme: str This is usually 'http' or 'https'.
... TODO
query: dict of strings The URL query parameters. The keys and values are
both escaped so this dict should contain the unescaped values.
- modify_request(self, http_request=None)
- Sets HTTP request components based on the URI.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes defined here:
- host = None
- path = None
- port = None
- scheme = None
| |