t.w._.Request : class documentation

Part of twisted.web._newclient View Source View In Hierarchy

Implements interfaces: twisted.web.iweb.IClientRequest

A Request instance describes an HTTP request to be sent to an HTTP server.
Instance Variable method See __init__.
Instance Variable uri See __init__.
Instance Variable headers See __init__.
Instance Variable bodyProducer See __init__.
Instance Variable persistent See __init__.
Method __init__
Method absoluteURI The absolute URI of the request as bytes, or None if the absolute URI cannot be determined.
Method writeTo Format this Request as an HTTP/1.1 request and write it to the given transport. If bodyProducer is not None, it will be associated with an IConsumer.
Method stopWriting No summary
Instance Variable _parsedURI Parsed URI for the request, or None. (type: _URI)
Class Method _construct Private constructor.
Method _writeHeaders Undocumented
Method _writeToChunked Write this request to the given transport using chunked transfer-encoding to frame the body.
Method _writeToContentLength Write this request to the given transport using content-length to frame the body.
method =
See __init__.
uri =
See __init__.
headers =
See __init__.
bodyProducer =
See __init__.
persistent =
See __init__.
_parsedURI =
Parsed URI for the request, or None. (type: _URI)
def __init__(self, method, uri, headers, bodyProducer, persistent=False): (source)
ParametersmethodThe HTTP method to for this request, ex: 'GET', 'HEAD', 'POST', etc. (type: str)
uriThe relative URI of the resource to request. For example, '/foo/bar?baz=quux'. (type: str)
headersHeaders to be sent to the server. It is important to note that this object does not create any implicit headers. So it is up to the HTTP Client to add required headers such as 'Host'. (type: twisted.web.http_headers.Headers)
bodyProducerNone or an IBodyProducer provider which produces the content body to send to the remote HTTP server.
persistentSet to True when you use HTTP persistent connection, defaults to False. (type: bool)
@classmethod
def _construct(cls, method, uri, headers, bodyProducer, persistent=False, parsedURI=None): (source)
Private constructor.
ParametersmethodSee __init__.
uriSee __init__.
headersSee __init__.
bodyProducerSee __init__.
persistentSee __init__.
parsedURISee Request._parsedURI.
ReturnsRequest instance.
@property
def absoluteURI(self): (source)
The absolute URI of the request as bytes, or None if the absolute URI cannot be determined.
def _writeHeaders(self, transport, TEorCL): (source)
Undocumented
def _writeToChunked(self, transport): (source)
Write this request to the given transport using chunked transfer-encoding to frame the body.
def _writeToContentLength(self, transport): (source)
Write this request to the given transport using content-length to frame the body.
def writeTo(self, transport): (source)
Format this Request as an HTTP/1.1 request and write it to the given transport. If bodyProducer is not None, it will be associated with an IConsumer.
ReturnsA Deferred which fires with None when the request has been completely written to the transport or with a Failure if there is any problem generating the request bytes.
def stopWriting(self): (source)
Stop writing this request to the transport. This can only be called after writeTo and before the Deferred returned by writeTo fires. It should cancel any asynchronous task started by writeTo. The Deferred returned by writeTo need not be fired if this method is called.
API Documentation for Twisted, generated by pydoctor at 2014-05-12 18:27:00.