HyperText Transfer Protocol implementation.
This is the basic server-side protocol implementation used by the Twisted Web server. It can parse HTTP 1.0 requests and supports many HTTP 1.1 features as well. Additionally, some functionality implemented here is also useful for HTTP clients (such as the chunked encoding parser).
Class | HTTPChannel |
A receiver for HTTP requests. |
Class | HTTPClient |
A client for HTTP 1.0. |
Class | HTTPFactory |
Factory for HTTP server. |
Class | PotentialDataLoss |
No summary |
Class | Request |
A HTTP request. |
Class | StringTransport |
I am a BytesIO wrapper that conforms for the transport API. I support the `writeSequence' method. |
Function | combinedLogFormatter |
|
Function | datetimeToLogString |
Convert seconds since epoch to log datetime string. |
Function | datetimeToString |
Convert seconds since epoch to HTTP datetime string. |
Function | fromChunk |
Convert chunk to string. |
Function | parse_qs |
Like cgi.parse_qs, but with support for parsing byte strings on Python 3. |
Function | parseContentRange |
Parse a content-range header into (start, end, realLength). |
Function | proxiedLogFormatter |
|
Function | stringToDatetime |
Convert an HTTP date string (one of three formats) to seconds since epoch. |
Function | timegm |
Convert time tuple in GMT to seconds since epoch, GMT |
Function | toChunk |
Convert string to a chunk. |
Function | urlparse |
Parse an URL into six components. |
Constant | ACCEPTED |
Undocumented |
Constant | BAD_GATEWAY |
Undocumented |
Constant | BAD_REQUEST |
Undocumented |
Constant | CACHED |
A marker value to be returned from cache-related request methods to indicate to the caller that a cached response will be usable and no response body should be generated. |
Constant | CONFLICT |
Undocumented |
Constant | CREATED |
Undocumented |
Constant | EXPECTATION_FAILED |
Undocumented |
Constant | FORBIDDEN |
Undocumented |
Constant | FOUND |
Undocumented |
Constant | GATEWAY_TIMEOUT |
Undocumented |
Constant | GONE |
Undocumented |
Constant | H2_ENABLED |
Undocumented |
Constant | HTTP_VERSION_NOT_SUPPORTED |
Undocumented |
Constant | INSUFFICIENT_STORAGE_SPACE |
Undocumented |
Constant | INTERNAL_SERVER_ERROR |
Undocumented |
Constant | LENGTH_REQUIRED |
Undocumented |
Constant | MOVED_PERMANENTLY |
Undocumented |
Constant | MULTI_STATUS |
Undocumented |
Constant | MULTIPLE_CHOICE |
Undocumented |
Constant | NO_BODY_CODES |
Undocumented |
Constant | NO_CONTENT |
Undocumented |
Constant | NON_AUTHORITATIVE_INFORMATION |
Undocumented |
Constant | NOT_ACCEPTABLE |
Undocumented |
Constant | NOT_ALLOWED |
Undocumented |
Constant | NOT_EXTENDED |
Undocumented |
Constant | NOT_FOUND |
Undocumented |
Constant | NOT_IMPLEMENTED |
Undocumented |
Constant | NOT_MODIFIED |
Undocumented |
Constant | OK |
Undocumented |
Constant | PARTIAL_CONTENT |
Undocumented |
Constant | PAYMENT_REQUIRED |
Undocumented |
Constant | PERMANENT_REDIRECT |
Undocumented |
Constant | PRECONDITION_FAILED |
Undocumented |
Constant | PROXY_AUTH_REQUIRED |
Undocumented |
Constant | REQUEST_ENTITY_TOO_LARGE |
Undocumented |
Constant | REQUEST_TIMEOUT |
Undocumented |
Constant | REQUEST_URI_TOO_LONG |
Undocumented |
Constant | REQUESTED_RANGE_NOT_SATISFIABLE |
Undocumented |
Constant | RESET_CONTENT |
Undocumented |
Constant | RESPONSES |
Undocumented |
Constant | SEE_OTHER |
Undocumented |
Constant | SERVICE_UNAVAILABLE |
Undocumented |
Constant | SWITCHING |
Undocumented |
Constant | TEMPORARY_REDIRECT |
Undocumented |
Constant | UNAUTHORIZED |
Undocumented |
Constant | UNSUPPORTED_MEDIA_TYPE |
Undocumented |
Constant | USE_PROXY |
Undocumented |
Variable | monthname |
Undocumented |
Variable | monthname_lower |
Undocumented |
Variable | protocol_version |
Undocumented |
Variable | weekdayname |
Undocumented |
Variable | weekdayname_lower |
Undocumented |
Interface | _IDeprecatedHTTPChannelToRequestInterface |
The interface HTTPChannel expects of Request . |
Class | _ChunkedTransferDecoder |
No summary |
Class | _DataLoss |
No summary |
Class | _GenericHTTPChannelProtocol |
A proxy object that wraps one of the HTTP protocol objects, and switches between them depending on TLS negotiated protocol. |
Class | _IdentityTransferDecoder |
Protocol for accumulating bytes up to a specified length. This handles the case where no Transfer-Encoding is specified. |
Class | _MalformedChunkedDataError |
No summary |
Class | _NoPushProducer |
A no-op version of interfaces.IPushProducer , used to abstract over the possibility that a HTTPChannel transport does not provide IPushProducer . |
Class | _XForwardedForAddress |
IAddress which represents the client IP to log for a request, as gleaned from an X-Forwarded-For header. |
Class | _XForwardedForRequest |
Add a layer on top of another request that only uses the value of an X-Forwarded-For header as the result of getClientAddress. |
Function | _escape |
Return a string like python repr, but always escaped as if surrounding quotes were double quotes. |
Function | _genericHTTPChannelProtocolFactory |
Returns an appropriately initialized _GenericHTTPChannelProtocol. |
Function | _getContentFile |
Get a writeable file-like object to which request content can be written. |
Function | _parseHeader |
Undocumented |
Constant | _QUEUED_SENTINEL |
Undocumented |
Constant | _REQUEST_TIMEOUT |
Undocumented |
Variable | _hostHeaderExpression |
Undocumented |
Parameters | |
data:bytes | Undocumented |
Returns | |
tuple of (result, remaining) - both bytes. | |
Raises | |
ValueError | If the given data is not a correctly formatted chunked byte string. |
Parameters | |
qs:bytes | Undocumented |
keep_blank_values | Undocumented |
strict_parsing | Undocumented |
Parse a content-range header into (start, end, realLength).
realLength might be None if real length is not known ('*').
Returns | |
A combined log formatted log line for the given request but use the value of the X-Forwarded-For header as the value for the client IP address. | |
See Also | |
IAccessLogFormatter |
Parameters | |
dateString:bytes | Undocumented |
Parameters | |
data:bytes | Undocumented |
Returns | |
a tuple of bytes representing the chunked encoding of data |
Parse an URL into six components.
This is similar to urlparse.urlparse, but rejects str input and always produces bytes output.
Parameters | |
url:bytes | Undocumented |
Returns | |
ParseResultBytes | The scheme, net location, path, params, query string, and fragment of the URL - all as bytes. |
Raises | |
TypeError | The given url was a str string instead of a bytes. |
Value |
|
Undocumented
Value |
|