class documentation
class Headers(typing.MutableMapping[
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 |
Undocumented |
Method | get |
Return a header value. If multiple occurrences of the header occur then concatenate them together with commas. |
Method | get |
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 |
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 |
Undocumented
Parameters | |
headers:typing.Optional[ | Undocumented |
encoding:typing.Optional[ | Undocumented |
Return a header value. If multiple occurrences of the header occur then concatenate them together with commas.
Parameters | |
key:str | Undocumented |
default:typing.Any | Undocumented |
Returns | |
typing.Any | Undocumented |
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:str | Undocumented |
splitbool | Undocumented |
Returns | |
typing.List[ | Undocumented |
Return `(key, value)` items of headers. Concatenate headers into a single comma separated value when a key occurs multiple times.
Returns | |
typing.ItemsView[ | Undocumented |
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[ | Undocumented |