t.w.c.h.HTTPParser(object) : class documentation

Part of twisted.web2.channel.http View Source View In Hierarchy

Known subclasses: twisted.web2.channel.http.HTTPChannelRequest, twisted.web2.client.http.HTTPClientChannelRequest

This class handles the parsing side of HTTP processing. With a suitable subclass, it can parse either the client side or the server side of the connection.
Method __init__ Undocumented
Method lineReceived Undocumented
Method rawDataReceived Handle incoming content.
Method headerReceived Store this header away. Check for too much header data (> channel.maxHeaderLength) and abort the connection if so.
Method allHeadersReceived Undocumented
Method allContentReceived Undocumented
Method splitConnectionHeaders Split off connection control headers from normal headers.
Method setConnectionParams Undocumented
Method abortParse Undocumented
Method pauseProducing Undocumented
Method resumeProducing Undocumented
Method stopProducing Undocumented
def __init__(self, channel): (source)
Undocumented
def lineReceived(self, line): (source)
Undocumented
def rawDataReceived(self, data): (source)
Handle incoming content.
def headerReceived(self, line): (source)
Store this header away. Check for too much header data (> channel.maxHeaderLength) and abort the connection if so.
def allHeadersReceived(self): (source)
Undocumented
def allContentReceived(self): (source)
Undocumented
def splitConnectionHeaders(self): (source)

Split off connection control headers from normal headers.

The normal headers are then passed on to user-level code, while the connection headers are stashed in .connHeaders and used for things like request/response framing.

This corresponds roughly with the HTTP RFC's description of 'hop-by-hop' vs 'end-to-end' headers in RFC2616 S13.5.1, with the following exceptions:
  • proxy-authenticate and proxy-authorization are not treated as connection headers.
  • content-length is, as it is intimately related with low-level HTTP parsing, and is made available to user-level code via the stream length, rather than a header value. (except for HEAD responses, in which case it is NOT used by low-level HTTP parsing, and IS kept in the normal headers.
def setConnectionParams(self, connHeaders): (source)
Undocumented
def abortParse(self): (source)
Undocumented
def pauseProducing(self): (source)
Undocumented
def resumeProducing(self): (source)
Undocumented
def stopProducing(self): (source)
Undocumented
API Documentation for Twisted, generated by pydoctor at 2011-10-27 16:12:41.