An HTTP parser which only handles HTTP responses.

Instance Variable request The request with which the expected response is associated. (type: Request)
Instance Variable NO_BODY_CODES A set of response codes which MUST NOT have a body.
Instance Variable finisher A callable to invoke when this response is fully parsed.
Method __init__ Undocumented
Method dataReceived Override so that we know if any response has been received.
Method parseVersion Parse version strings of the form Protocol '/' Major '.' Minor. E.g. b'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.
Instance Variable _responseDeferred A Deferred which will be called back with the response when all headers in the response have been received. Thereafter, None.
Instance Variable _everReceivedData True if any bytes have been received.
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 _PauseableMixin (via HTTPParser, LineReceiver):

Method pauseProducing Undocumented
Method resumeProducing Undocumented
Method stopProducing Undocumented

Inherited from _PauseableMixin (via HTTPParser, LineReceiver):

Method pauseProducing Undocumented
Method resumeProducing Undocumented
Method stopProducing Undocumented

Inherited from _PauseableMixin (via HTTPParser, LineReceiver):

Method pauseProducing Undocumented
Method resumeProducing Undocumented
Method stopProducing Undocumented

Inherited from _PauseableMixin (via HTTPParser, LineReceiver):

Method pauseProducing Undocumented
Method resumeProducing Undocumented
Method stopProducing Undocumented

Inherited from _PauseableMixin (via HTTPParser, LineReceiver):

Method pauseProducing Undocumented
Method resumeProducing Undocumented
Method stopProducing Undocumented
request =
The request with which the expected response is associated. (type: Request)
NO_BODY_CODES =
A set of response codes which MUST NOT have a body.
finisher =
A callable to invoke when this response is fully parsed.
_responseDeferred =
A Deferred which will be called back with the response when all headers in the response have been received. Thereafter, None.
_everReceivedData =
True if any bytes have been received.
def __init__(self, request, finisher): (source)
Undocumented
def dataReceived(self, data): (source)

Override so that we know if any response has been received.

def parseVersion(self, strversion): (source)

Parse version strings of the form Protocol '/' Major '.' Minor. E.g. b'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 bytes 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.

API Documentation for Twisted, generated by pydoctor at 2015-09-04 15:29:41.