t.w._.HTTPClientParser(HTTPParser) : class documentation

Part of twisted.web._newclient View Source View In Hierarchy

An HTTP parser which only handles HTTP responses.
Instance VariablesrequestThe request with which the expected response is associated. (type: Request )
NO_BODY_CODESA set of response codes which MUST NOT have a body.
finisherA callable to invoke when this response is fully parsed.
_responseDeferredA Deferred which will be called back with the response when all headers in the response have been received. Thereafter, None.
Method __init__ Undocumented
Method parseVersion Parse version strings of the form Protocol '/' Major '.' Minor. E.g. 'HTTP/1.1'. Returns (protocol, major, minor). Will raise ValueError on bad syntax.
Method statusReceived Parse the status line into its components and create a response object to keep track of this response's state.
Method isConnectionControlHeader Content-Length in the response to a HEAD request is an entity header, not a connection control header.
Method allHeadersReceived Figure out how long the response body is going to be by examining headers and stuff.
Method connectionLost Called when the connection is shut down.
Method _finished Called to indicate that an entire response has been received. No more bytes will be interpreted by this HTTPClientParser. Extra bytes are passed up and the state of this HTTPClientParser is set to DONE.

Inherited from HTTPParser:

Method connectionMade Called when a connection is made.
Method switchToBodyMode Switch to body parsing mode - interpret any more bytes delivered as part of the message body and deliver them to the given decoder.
Method lineReceived Handle one line from a response.
Method rawDataReceived Pass data from the message body to the body decoder object.
Method headerReceived Store the given header in self.headers.

Inherited from LineReceiver (via HTTPParser):

Method clearLineBuffer Clear buffered data.
Method dataReceived Protocol.dataReceived. Translates bytes into lines, and calls lineReceived (or rawDataReceived, depending on mode.)
Method setLineMode Sets the line-mode of this receiver.
Method setRawMode Sets the raw mode of this receiver. Further data received will be sent to rawDataReceived rather than lineReceived.
Method sendLine Sends a line to the other end of the connection.
Method lineLengthExceeded Called when the maximum line length has been reached. Override if it needs to be dealt with in some special way.

Inherited from BaseProtocol (via HTTPParser, LineReceiver, Protocol):

Method makeConnection Make a connection to a transport and a server.

Inherited from _PauseableMixin (via HTTPParser, LineReceiver):

Method pauseProducing Undocumented
Method resumeProducing Undocumented
Method stopProducing Undocumented
def __init__(self, request, finisher): (source)
Undocumented
def parseVersion(self, strversion): (source)
Parse version strings of the form Protocol '/' Major '.' Minor. E.g. 'HTTP/1.1'. Returns (protocol, major, minor). Will raise ValueError on bad syntax.
def statusReceived(self, status): (source)
Parse the status line into its components and create a response object to keep track of this response's state.
def _finished(self, rest): (source)
Called to indicate that an entire response has been received. No more bytes will be interpreted by this HTTPClientParser. Extra bytes are passed up and the state of this HTTPClientParser is set to DONE.
ParametersrestA str giving any extra bytes delivered to this HTTPClientParser which are not part of the response being parsed.
def isConnectionControlHeader(self, name): (source)
Content-Length in the response to a HEAD request is an entity header, not a connection control header.
def allHeadersReceived(self): (source)
Figure out how long the response body is going to be by examining headers and stuff.
def connectionLost(self, reason): (source)

Called when the connection is shut down.

Clear any circular references here, and any external references to this Protocol. The connection has been closed.
Parametersreason (type: twisted.python.failure.Failure )
API Documentation for Twisted, generated by pydoctor at 2011-10-27 16:17:34.