A HTTP request.
Subclasses should override the process() method to determine how the
request will be processed.
|
|
|
__providedBy__(...)
Object Specification Descriptor |
source code
|
|
|
|
|
|
|
__setattr__(self,
name,
value)
Support assignment of dict instances to
received_headers for backwards-compatibility. |
|
|
|
|
|
_cleanup(self)
Called when have finished responding and are no longer queued. |
|
|
|
_sendError(self,
code,
resp='
' ) |
|
|
|
addCookie(self,
k,
v,
expires=None,
domain=None,
path=None,
max_age=None,
comment=None,
secure=None)
Set an outgoing HTTP cookie. |
|
|
|
connectionLost(self,
reason)
There is no longer a connection for this request to respond over. |
|
|
|
finish(self)
Indicate that all response data has been written to this Request . |
|
|
|
getAllHeaders(self)
Return dictionary mapping the names of all received headers to the
last value received for each. |
|
|
|
|
str
|
getClientIP(self)
Return the IP address of the client who submitted this request. |
|
|
|
getCookie(self,
key)
Get a cookie that was sent from the network. |
|
|
str or NoneType
|
getHeader(self,
key)
Get an HTTP request header. |
|
|
|
getHost(self)
Get my originally requesting transport's host. |
|
|
str
|
getPassword(self)
Return the HTTP password sent with this request, if any. |
|
|
str
|
|
str
|
getUser(self)
Return the HTTP user sent with this request, if any. |
|
|
|
gotLength(self,
length)
Called when HTTP channel got length of content in this request. |
|
|
|
|
bool
|
isSecure(self)
Return True if this request is using a secure transport. |
|
|
|
|
Deferred
|
notifyFinish(self)
Notify when the response to this request has finished. |
|
|
|
|
|
process(self)
Override in subclasses. |
|
|
|
redirect(self,
url)
Utility function that does a redirect. |
|
|
|
registerProducer(self,
producer,
streaming)
Register a producer. |
|
|
|
requestReceived(self,
command,
path,
version)
Called by channel when all data has been received. |
|
|
|
setETag(self,
etag)
Set an entity tag for the outgoing response. |
|
|
|
setHeader(self,
name,
value)
Set an HTTP response header. |
|
|
|
setHost(self,
host,
port,
ssl=0)
Change the host and port the request thinks it's using. |
|
|
|
setLastModified(self,
when)
Set the Last-Modified time for the response to this
request. |
|
|
|
setResponseCode(self,
code,
message=None)
Set the HTTP response code. |
|
|
|
unregisterProducer(self)
Unregister the producer. |
|
|
|
write(self,
data)
Write some data as a result of an HTTP request. |
|
|
bool
|
_disconnected = False
A flag which is False until the connection over which
this request was received is closed and which is True
after that.
|
A mapping of strings (the argument names) to lists of values. i.e.,
?foo=bar&foo=baz&quux=spam results in {'foo': ['bar', 'baz'],
'quux': ['spam']}.
|
args = None
All of the arguments, including URL and POST arguments.
|
|
headers
Backwards-compatibility access to responseHeaders .
|
|
method = ' (no method yet) '
The HTTP method that was used.
|
|
notifications
A list of Deferred s which are
waiting for notification that the response to this request has been
finished (successfully or with an error).
|
|
path = None
The path only (arguments not included).
|
|
received_headers
Backwards-compatibility access to requestHeaders .
|
http_headers.Headers
|
requestHeaders
All received HTTP request headers.
|
http_headers.Headers
|
responseHeaders
All HTTP response headers to be sent.
|
|
uri = ' (no uri yet) '
The full URI that was requested (includes arguments).
|