Part of twisted.web2.compat View Source View In Hierarchy
Implements interfaces: twisted.web.iweb.IRequest
|Method||getStateToCopyFor||Gather state to send when I am serialized for a particular perspective.|
|Method||getTypeToCopy||Determine what type tag to send for me.|
|Method||finish||Indicate that the response to this request is complete.|
|Method||write||Write some data to the body of the response to this request. Response headers are written the first time this method is called, after which new response headers may not be added.|
|Method||getHeader||Get an HTTP request header.|
|Method||setHeader||Set an outgoing HTTP header.|
|Method||setResponseCode||Set the HTTP response code.|
|Method||getAllHeaders||Return dictionary mapping the names of all received headers to the last value received for each.|
|Method||getRequestHostname||Get the hostname that the user passed in to the request.|
|Method||getCookie||Get a cookie that was sent from the network.|
|Method||addCookie||Set an outgoing HTTP cookie.|
|Method||getHost||Get my originally requesting transport's host.|
|Method||setHost||Change the host and port the request thinks it's using.|
|Method||isSecure||Return True if this request is using a secure transport.|
|Method||getClientIP||Return the IP address of the client who submitted this request.|
|Method||getClient||Return the hostname of the IP address of the client who submitted this request, if possible.|
|Method||getUser||Return the HTTP user sent with this request, if any.|
|Method||getPassword||Return the HTTP password sent with this request, if any.|
|Method||sibLink||Return the text that links to a sibling of the requested resource.|
|Method||childLink||Return the text that links to a child of the requested resource.|
|Method||redirect||Utility function that does a redirect.|
|Method||rememberRootURL||Remember the currently-processed part of the URL for later recalling.|
|Method||getRootURL||Get a previously-remembered URL.|
|Method||getSession||Look up the session associated with this request or create a new one if there is not one.|
Inherited from Copyable:
|Method||getStateToCopy||Gather state to send when I am serialized for a peer.|
|Method||getTypeToCopyFor||Determine what type tag to send for me.|
|Method||jellyFor||Assemble type tag and state to copy for this broker.|
|Method||processUniqueID||Return an ID which uniquely represents this object for this process.|
Inherited from Componentized:
|Method||addAdapter||Utility method that calls addComponent. I take an adapter class and instantiate it with myself as the first argument.|
|Method||addComponent||Add a component to me, for all appropriate interfaces.|
|Method||unsetComponent||Remove my component specified by the given interface class.|
|Method||removeComponent||Remove the given component from me entirely, for all interfaces for which it has been registered.|
|Method||getComponent||Create or retrieve an adapter for the given interface.|
|Method||__getstate__||Get state, adding a version number to it on its way out.|
|Method||versionUpgrade||(internal) Do a version upgrade.|
Gather state to send when I am serialized for a particular perspective.I will default to calling
getStateToCopy. Override this to customize this behavior.
Determine what type tag to send for me.By default, send the string representation of my class (package.module.Class); normally this is adequate, but you may override this to change it.
|Parameters||key||The name of the header to get the value of.
|Returns||The value of the specified header, or |
Last-Modified time for the response to this
If I am called more than once, I ignore attempts to set Last-Modified earlier, only replacing the Last-Modified time if it is to a later value.If I am a conditional request, I may modify my response code to
NOT_MODIFIEDif appropriate for the time given.
|Parameters||when||The last time the resource being returned was modified, in seconds since
|Returns||If I am a |
entity tag for the outgoing response.
That's "entity tag" as in the HTTP/1.1
header, "used for comparing two or more entities from the same
PRECONDITION_FAILED, if appropriate for the tag given.
|Parameters||etag||The entity tag for the resource being returned.
|Returns||If I am a |
Return dictionary mapping the names of all received headers to the last value received for each.Since this method does not return all header information,
requestHeaders.getAllRawHeaders()may be preferred.
Get the hostname that the user passed in to the request.This will either use the Host: header (if it is available) or the host we are listening on if the header is unavailable.
|Returns||the requested hostname
Change the host and port the request thinks it's using.
This method is useful for working with reverse HTTP proxies (e.g. both Squid and Apache's mod_proxy can do this), when the address the HTTP client is using is different than the one we're listening on.For example, Apache may be listening on https://www.example.com, and then forwarding requests to http://localhost:8080, but we don't want HTML produced by Twisted to say 'http://localhost:8080', they should say 'https://www.example.com', so we do:
request.setHost('www.example.com', 443, ssl=1)
Return True if this request is using a secure transport.
Normally this method returns True if this request's HTTPChannel instance is using a transport that implements ISSLTransport.This will also return True if setHost() has been called with ssl=True.
|Returns||True if this request is secure
|Returns||the client IP address or |
Return the hostname of the IP address of the client who submitted this request, if possible.This method is deprecated. See
|Returns||The canonical hostname of the client, as determined by performing a name
lookup on the IP address of the client.
Return the HTTP user sent with this request, if any.If no user was supplied, return the empty string.
|Returns||the HTTP user, if any
Return the HTTP password sent with this request, if any.If no password was supplied, return the empty string.
|Returns||the HTTP password, if any
Utility function that does a redirect.The request should have finish() called after this.
|Returns||At any time during resource traversal, a |