t.w.s.Request(http.Request) : class documentation

Part of twisted.web2.server View Source View In Hierarchy

Implements interfaces: twisted.web2.iweb.IRequest

vars: site

remoteAddr

scheme host port path params querystring

args files

prepath postpath
Instance VariablespathThe path only (arguments not included).
argsAll of the arguments, including URL and POST arguments. (type: 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']}. )
Method __init__
Method addResponseFilter Undocumented
Method unparseURL No summary
Method process Process a request.
Method preprocessRequest No summary
Method urlForResource Looks up the URL of the given resource if this resource was found while processing this request. Specifically, this includes the requested resource, and resources looked up via locateResource.
Method locateResource No summary
Method locateChildResource No summary
Method renderHTTP_exception Undocumented
Method _parseURL Undocumented
Method _fixupURLParts Undocumented
Method _getChild Call res.locateChild, and pass the result on to _handleSegment.
Method _handleSegment Handle the result of a locateChild call done in _getChild.
Method _rememberResource Remember the URL of a visited resource.
Method _processingFailed Undocumented
Method _processingReallyFailed Undocumented
Method _cbFinishRender Undocumented

Inherited from Request:

Method checkExpect Ensure there are no expectations that cannot be met. Checks Expect header against self.known_expects.
Method handleContentChunk Callback from channel when a piece of data has been received. Puts the data in .stream
Method handleContentComplete Callback from channel when all data has been received.
Method connectionLost connection was lost
Method __repr__ Undocumented
Method writeResponse Write a response.
Method _sendContinue Undocumented
Method _finished We are finished writing data.
Method _error Undocumented
def __init__(self, *args, **kw): (source)
ParameterschanRequestthe channel request we're associated with.
def addResponseFilter(self, f, atEnd=False): (source)
Undocumented
def unparseURL(self, scheme=None, host=None, port=None, path=None, params=None, querystring=None, fragment=None): (source)
Turn the request path into a url string. For any pieces of the url that are not specified, use the value from the request. The arguments have the same meaning as the same named attributes of Request.
def _parseURL(self): (source)
Undocumented
def _fixupURLParts(self): (source)
Undocumented
def process(self): (source)
Process a request.
def preprocessRequest(self): (source)
Do any request processing that doesn't follow the normal resource lookup procedure. "OPTIONS *" is handled here, for example. This would also be the place to do any CONNECT processing.
def _getChild(self, _, res, path, updatepaths=True): (source)
Call res.locateChild, and pass the result on to _handleSegment.
def _handleSegment(self, result, res, path, updatepaths): (source)
Handle the result of a locateChild call done in _getChild.
def _rememberResource(self, resource, url): (source)
Remember the URL of a visited resource.
def urlForResource(self, resource): (source)

Looks up the URL of the given resource if this resource was found while processing this request. Specifically, this includes the requested resource, and resources looked up via locateResource.

Note that a resource may be found at multiple URIs; if the same resource is visited at more than one location while processing this request, this method will return one of those URLs, but which one is not defined, nor whether the same URL is returned in subsequent calls.
Parametersresourcethe resource to find a URI for. This resource must have been obtained from the request (ie. via its uri attribute, or through its locateResource or locateChildResource methods).
Returnsa valid URL for resource in this request.
RaisesNoURLForResourceErrorif resource has no URL in this request (because it was not obtained from the request).
def locateResource(self, url): (source)
Looks up the resource with the given URL.
ParametersuriThe URL of the desired resource.
Returnsa Deferred resulting in the IResource at the given URL or None if no such resource can be located.
RaisesHTTPErrorIf url is not a URL on the site that this request is being applied to. The contained response will have a status code of responsecode.BAD_GATEWAY.
HTTPErrorIf url contains a query or fragment. The contained response will have a status code of responsecode.BAD_REQUEST.
def locateChildResource(self, parent, childName): (source)
Looks up the child resource with the given name given the parent resource. This is similar to locateResource(), but doesn't have to start the lookup from the root resource, so it is potentially faster.
Parametersparentthe parent of the resource being looked up. This resource must have been obtained from the request (ie. via its uri attribute, or through its locateResource or locateChildResource methods).
childNamethe name of the child of parent to looked up. to parent.
Returnsa Deferred resulting in the IResource at the given URL or None if no such resource can be located.
RaisesNoURLForResourceErrorif resource was not obtained from the request.
def _processingFailed(self, reason): (source)
Undocumented
def _processingReallyFailed(self, reason, origReason): (source)
Undocumented
def _cbFinishRender(self, result): (source)
Undocumented
def renderHTTP_exception(self, req, reason): (source)
Undocumented
API Documentation for Twisted, generated by pydoctor at 2011-10-27 16:12:41.