class documentation

class HTTPHeadersWrappingHeaders: (source)

Implements interfaces: klein._imessage.IMutableHTTPHeaders

View In Hierarchy

HTTP entity headers.

This is an IMutableHTTPHeaders implementation that wraps a Headers object.

Method addValue Add the given header name/value pair.
Method getValues Get the values associated with the given header name.
Method remove Remove all header name/value pairs for the given header name.
Property rawHeaders Raw header data as a tuple in the from: ((name, value), ...). name and value are bytes. Headers are provided in the order that they were received. Headers with multiple values are provided as separate name and value pairs.
Instance Variable _headers Undocumented
def addValue(self, name, value): (source)

Add the given header name/value pair.

If the given name is bytes, the value must also be bytes.

If the given name is str, it will be encoded as ISO-8859-1, and the value, which must also be str, will be encoded as ISO-8859-1.

Parameters
name:AnyStrUndocumented
value:AnyStrUndocumented
def getValues(self, name): (source)

Get the values associated with the given header name.

If the given name is bytes, the value will be returned as the raw header bytes.

If the given name is str, the name will be encoded as ISO-8859-1 and the value will be returned as text, by decoding the raw header value bytes with ISO-8859-1.

Parameters
name:AnyStrThe name of the header to look for.
Returns
Iterable[AnyStr]The values of the header with the given name.
def remove(self, name): (source)

Remove all header name/value pairs for the given header name.

If the given name is str, it will be encoded as ISO-8859-1 before comparing to the (bytes) header names.

Parameters
name:StringThe name of the header to remove.
@property
rawHeaders: RawHeaders = (source)

Raw header data as a tuple in the from: ((name, value), ...). name and value are bytes. Headers are provided in the order that they were received. Headers with multiple values are provided as separate name and value pairs.

_headers: Headers = (source)

Undocumented