twisted.web.test.test_newclient._HTTPParserTests(object)
class documentationtwisted.web.test.test_newclient
(View In Hierarchy)
Known subclasses: twisted.web.test.test_newclient.HTTPParserNonRFCComplaintDelimeterTests, twisted.web.test.test_newclient.HTTPParserRFCComplaintDelimeterTests
Base test class for HTTPParser
which is responsible for the bulk of the task of parsing HTTP bytes.
Method | test_statusCallback | HTTPParser
calls its statusReceived method when it receives a status
line. |
Method | test_headerCallback | HTTPParser
calls its headerReceived method when it receives a header. |
Method | test_continuedHeaderCallback | If a header is split over multiple lines, HTTPParser
calls headerReceived with the entire value once it is
received. |
Method | test_fieldContentWhitespace | Leading and trailing linear whitespace is stripped from the header value
passed to the headerReceived callback. |
Method | test_allHeadersCallback | After the last header is received, HTTPParser
calls allHeadersReceived . |
Method | test_noHeaderCallback | If there are no headers in the message, HTTPParser
does not call headerReceived . |
Method | test_headersSavedOnResponse | All headers received by HTTPParser
are added to HTTPParser.headers . |
Method | test_connectionControlHeaders | HTTPParser.isConnectionControlHeader
returns True for headers which are always connection control
headers (similar to "hop-by-hop" headers from RFC 2616 section
13.5.1) and False for other headers. |
Method | test_switchToBodyMode | HTTPParser.switchToBodyMode
raises RuntimeError
if called more than once. |
Method | _headerTestSetup | Undocumented |
HTTPParser
calls its statusReceived
method when it receives a status
line.
HTTPParser
calls its headerReceived
method when it receives a header.
If a header is split over multiple lines, HTTPParser
calls headerReceived
with the entire value once it is
received.
Leading and trailing linear whitespace is stripped from the header value
passed to the headerReceived
callback.
After the last header is received, HTTPParser
calls allHeadersReceived
.
If there are no headers in the message, HTTPParser
does not call headerReceived
.
All headers received by HTTPParser
are added to HTTPParser.headers
.
HTTPParser.isConnectionControlHeader
returns True
for headers which are always connection control
headers (similar to "hop-by-hop" headers from RFC 2616 section
13.5.1) and False
for other headers.
HTTPParser.switchToBodyMode
raises RuntimeError
if called more than once.