Go to the latest version of this document.

# ``twisted`.`web`.`http_headers``

module documentation
(source)

An API for storing HTTP header names and values.

Class | `Headers` | Stores HTTP headers in a key and multiple value format.
Exception | `InvalidHeaderName` | HTTP header names must be tokens, per RFC 9110 section 5.1.
Class | `_NameEncoder` | `_NameEncoder` converts HTTP header names to `bytes` and canonicalizies their capitalization.
Function | `_sanitizeLinearWhitespace` | Replace linear whitespace (`\n`, `\r\n`, `\r`) in a header value with a single space.
Type Variable | `_T` | Undocumented
Variable | `_nameEncoder` | The global name encoder.

def _sanitizeLinearWhitespace(headerComponent: `bytes`) -> `bytes`: (source)

Replace linear whitespace (`\n`, `\r\n`, `\r`) in a header value with a single space.

Parameters
headerComponent:`bytes` | The header value to sanitize.

Returns
`bytes` | The sanitized header value.

_T = (source)

Undocumented

Value

    TypeVar('_T')

_nameEncoder = (source)

The global name encoder.