Bases: object
Find parameters in Accept header for given content type.
Bases: paste.urlmap.URLMap
Parse lists as described by RFC 2068 Section 2.
In particular, parse comma-separated lists where the elements of the list may include quoted-strings. A quoted-string could contain a comma. A non-quoted string could have quotes in the middle. Quotes are removed automatically after parsing.
The return value is a standard list:
>>> parse_list_header('token, "quoted value"')
['token', 'quoted value']
Parameters: | value – a string with a list header. |
---|---|
Returns: | list |
Parse ‘Content-Type’-like header into a tuple.
Parse a Content-Type like header into a tuple with the content type and the options:
>>> parse_options_header('Content-Type: text/html; mimetype=text/html')
('Content-Type:', {'mimetype': 'text/html'})
Parameters: | value – the header to parse. |
---|---|
Returns: | (str, options) |
Unquotes a header value.
This does not use the real unquoting but what browsers are actually using for quoting.
Parameters: | value – the header value to unquote. |
---|