Class t.w.r.RedirectResource(LeafResource):

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

Implements interfaces: twisted.web2.iweb.IResource
A LeafResource which always performs a redirect.
Method __init__ Parameters are URL components and are the same as those for
Method renderHTTP See iweb.IResource.renderHTTP.

Inherited from LeafResource:

Method locateChild Locate another object which can be adapted to IResource.

Inherited from RenderMixin (via LeafResource):

Method allowedMethods
Method checkPreconditions Checks all preconditions imposed by this resource upon a request made
Method http_OPTIONS Respond to a OPTIONS request.
Method http_TRACE Respond to a TRACE request.
Method http_HEAD Respond to a HEAD request.
Method http_GET Respond to a GET request.
Method render Subclasses should implement this method to do page rendering.
def __init__(self, *args, **kwargs): (source)
Parameters are URL components and are the same as those for urlparse.urlunparse. URL components which are not specified will default to the corresponding component of the URL of the request being redirected.
def renderHTTP(self, request): (source)

See iweb.IResource.renderHTTP.

This implementation will dispatch the given request to another method of self named http_METHOD, where METHOD is the HTTP method used by request (eg. http_GET, http_POST, etc.).

Generally, a subclass should implement those methods instead of overriding this one.

http_* methods are expected provide the same interface and return the same results as iweb.IResource.renderHTTP (and therefore this method).

etag and last-modified are added to the response returned by the http_* header, if known.

If an appropriate http_* method is not found, a responsecode.NOT_ALLOWED-status response is returned, with an appropriate allow header.
Parametersrequestthe request to process.
Returnsan object adaptable to iweb.IResponse.
API Documentation for twisted, generated by pydoctor.