Interface t.w.i.IChanRequest(Interface):

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

Undocumented
Line # Kind Name Docs
301 Method writeIntermediateResponse Write a non-terminating response.
314 Method writeHeaders Write a final response.
325 Method write Write some data.
333 Method finish Finish the request, and clean up the connection if necessary.
338 Method abortConnection Forcibly abort the connection without cleanly closing.
344 Method registerProducer Register a producer with the standard API.
348 Method unregisterProducer Unregister a producer.
352 Method getHostInfo Returns a tuple of (address, socket user connected to,
360 Method getRemoteHost Returns an address of the remote host.
def writeIntermediateResponse(code, headers=None):

Write a non-terminating response.

Intermediate responses cannot contain data. If the channel does not support intermediate responses, do nothing.
Parameterscode(type: int )
headers(type: twisted.web.http_headers.Headers )
Instance VariablescodeThe response code. Should be in the 1xx range.
headersthe headers to send in the response
def writeHeaders(code, headers):
Write a final response.
ParameterscodeThe response code. Should not be in the 1xx range. (type: int )
headersthe headers to send in the response. They will be augmented with any connection-oriented headers as necessary for the protocol. (type: twisted.web.http_headers.Headers )
def write(data):
Write some data.
Parametersdatathe data bytes (type: str )
def finish():
Finish the request, and clean up the connection if necessary.
def abortConnection():
Forcibly abort the connection without cleanly closing. Use if, for example, you can't write all the data you promised.
def registerProducer(producer, streaming):
Register a producer with the standard API.
def unregisterProducer():
Unregister a producer.
def getHostInfo():
Returns a tuple of (address, socket user connected to, boolean, was it secure). Note that this should not necsessarily always return the actual local socket information from twisted. E.g. in a CGI, it should use the variables coming from the invoking script.
def getRemoteHost():

Returns an address of the remote host.

Like getHostInfo, this information may come from the real socket, or may come from additional information, depending on the transport.