class documentation

HTTP headers, as a case-insensitive multi-dict.

Method __contains__ Undocumented
Method __delitem__ Remove the header `key`.
Method __eq__ Undocumented
Method __getitem__ Return a single header value.
Method __init__ Undocumented
Method __iter__ Undocumented
Method __len__ Undocumented
Method __repr__ Undocumented
Method __setitem__ Set the header `key` to `value`, removing any duplicate entries. Retains insertion order.
Method copy Undocumented
Method encoding.setter Undocumented
Method get Return a header value. If multiple occurrences of the header occur then concatenate them together with commas.
Method get_list Return a list of all header values for a given key. If `split_commas=True` is passed, then any comma separated header values are split into multiple return strings.
Method items Return `(key, value)` items of headers. Concatenate headers into a single comma separated value when a key occurs multiple times.
Method keys Undocumented
Method multi_items Return a list of `(key, value)` pairs of headers. Allow multiple occurrences of the same key without concatenating into a single comma separated value.
Method update Undocumented
Method values Undocumented
Property encoding Header encoding is mandated as ascii, but we allow fallbacks to utf-8 or iso-8859-1.
Property raw Returns a list of the raw header items, as byte pairs.
Instance Variable _encoding Undocumented
Instance Variable _list Undocumented
def __contains__(self, key): (source)

Undocumented

Parameters
key:typing.AnyUndocumented
Returns
boolUndocumented
def __delitem__(self, key): (source)

Remove the header `key`.

Parameters
key:strUndocumented
def __eq__(self, other): (source)

Undocumented

Parameters
other:typing.AnyUndocumented
Returns
boolUndocumented
def __getitem__(self, key): (source)

Return a single header value. If there are multiple headers with the same key, then we concatenate them with commas. See: https://tools.ietf.org/html/rfc7230#section-3.2.2

Parameters
key:strUndocumented
Returns
strUndocumented
def __init__(self, headers=None, encoding=None): (source)

Undocumented

Parameters
headers:typing.Optional[HeaderTypes]Undocumented
encoding:typing.Optional[str]Undocumented
def __iter__(self): (source)

Undocumented

Returns
typing.Iterator[typing.Any]Undocumented
def __len__(self): (source)

Undocumented

Returns
intUndocumented
def __repr__(self): (source)

Undocumented

Returns
strUndocumented
def __setitem__(self, key, value): (source)

Set the header `key` to `value`, removing any duplicate entries. Retains insertion order.

Parameters
key:strUndocumented
value:strUndocumented
def copy(self): (source)

Undocumented

Returns
HeadersUndocumented
@encoding.setter
def encoding(self, value): (source)

Undocumented

Parameters
value:strUndocumented
def get(self, key, default=None): (source)

Return a header value. If multiple occurrences of the header occur then concatenate them together with commas.

Parameters
key:strUndocumented
default:typing.AnyUndocumented
Returns
typing.AnyUndocumented
def get_list(self, key, split_commas=False): (source)

Return a list of all header values for a given key. If `split_commas=True` is passed, then any comma separated header values are split into multiple return strings.

Parameters
key:strUndocumented
split_commas:boolUndocumented
Returns
typing.List[str]Undocumented
def items(self): (source)

Return `(key, value)` items of headers. Concatenate headers into a single comma separated value when a key occurs multiple times.

Returns
typing.ItemsView[str, str]Undocumented
def keys(self): (source)

Undocumented

Returns
typing.KeysView[str]Undocumented
def multi_items(self): (source)

Return a list of `(key, value)` pairs of headers. Allow multiple occurrences of the same key without concatenating into a single comma separated value.

Returns
typing.List[typing.Tuple[str, str]]Undocumented
def update(self, headers=None): (source)

Undocumented

Parameters
headers:typing.Optional[HeaderTypes]Undocumented
def values(self): (source)

Undocumented

Returns
typing.ValuesView[str]Undocumented

Header encoding is mandated as ascii, but we allow fallbacks to utf-8 or iso-8859-1.

Returns a list of the raw header items, as byte pairs.

_encoding = (source)

Undocumented