Part of twisted.web2.resource View Source View In Hierarchy
Known subclasses: twisted.web2.resource.Resource, twisted.web2.resource.LeafResource, twisted.web2.static.StaticRenderMixin
| Line # | Kind | Name | Docs |
|---|---|---|---|
| 19 | Method | allowedMethods | |
| 27 | Method | checkPreconditions | Checks all preconditions imposed by this resource upon a request made |
| 53 | Method | renderHTTP | See iweb.IResource.renderHTTP. |
| 89 | Method | http_OPTIONS | Respond to a OPTIONS request. |
| 99 | Method | http_TRACE | Respond to a TRACE request. |
| 107 | Method | http_HEAD | Respond to a HEAD request. |
| 115 | Method | http_GET | Respond to a GET request. |
| 130 | Method | render | Subclasses should implement this method to do page rendering. |
| Returns | A tuple of HTTP methods that are allowed to be invoked on this resource. | |
| Parameters | request | the request to process. |
| Returns | None or a deferred whose callback value is
request.
| |
| Raises | http.HTTPError | if any precondition fails. |
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.
http_* method is not found, a
responsecode.NOT_ALLOWED-status response is returned, with an appropriate
allow header.
| Parameters | request | the request to process. |
| Returns | an object adaptable to iweb.IResponse. | |
| Parameters | request | the request to process. |
| Returns | an object adaptable to iweb.IResponse. | |
| Parameters | request | the request to process. |
| Returns | an object adaptable to iweb.IResponse. | |
| Parameters | request | the request to process. |
| Returns | an object adaptable to iweb.IResponse. | |
Respond to a GET request.
This implementation validates that the request body is empty and then dispatches the givenrequest to render
and returns its result.
| Parameters | request | the request to process. |
| Returns | an object adaptable to iweb.IResponse. | |
| Parameters | request | the request to process. |
| Returns | an object adaptable to iweb.IResponse. | |