Headers Support
This module implements support for parsing and handling headers.
Return a sorted HeaderElement list.
Returns a sorted HeaderElement list from a comma-separated header string.
Bases: object
An element (with parameters) from an HTTP header’s element list.
Transform ‘token;key=val’ to (‘token’, {‘key’: ‘val’}).
Construct an instance from a string of the form ‘token;key=val’.
Bases: circuits.web.headers.HeaderElement
An element (with parameters) from an Accept* header’s element list.
AcceptElement objects are comparable; the more-preferred object will be “less than” the less-preferred object. They are also therefore sortable; if you sort a list of AcceptElement objects, they will be listed in priority order; the most preferred value will be first. Yes, it should have been the other way around, but it’s too late to fix now.
The qvalue, or priority, of this value.
Bases: dict
A case-insensitive dict subclass.
Each key is changed on entry to str(key).title().
Bases: circuits.web.headers.CaseInsensitiveDict
Return a sorted list of HeaderElements for the given header.
Return a list of all the values for the named field.
Extended header setting.
_name is the header field to add. keyword arguments can be used to set additional parameters for the header field, with underscores converted to dashes. Normally the parameter will be added as key=”value” unless value is None, in which case only the key will be added.
Example:
h.add_header(‘content-disposition’, ‘attachment’, filename=’bud.gif’)
Note that unlike the corresponding ‘email.Message’ method, this does not handle ‘(charset, language, value)’ tuples: all values must be strings or None.