Home | Trees | Indices | Help |
|
---|
|
|
|||
generateAcceptHeader(*elements) Generate an accept header value |
|||
parseAcceptHeader(value) Parse an accept header, ignoring any accept-extensions |
|||
matchTypes(accept_types,
have_types) Given the result of parsing an Accept: header, and the available MIME types, return the acceptable types with their quality markdowns. |
|||
getAcceptable(accept_header,
have_types) Parse the accept header and return a list of available types in preferred order. |
|
Generate an accept header value [str or (str, float)] -> str |
Parse an accept header, ignoring any accept-extensions returns a list of tuples containing main MIME type, MIME subtype, and quality markdown. str -> [(str, str, float)] |
Given the result of parsing an Accept: header, and the available MIME types, return the acceptable types with their quality markdowns. For example:>>> acceptable = parseAcceptHeader('text/html, text/plain; q=0.5') >>> matchTypes(acceptable, ['text/plain', 'text/html', 'image/jpeg']) [('text/html', 1.0), ('text/plain', 0.5)]Type signature: ([(str, str, float)], [str]) -> [(str, float)] |
Parse the accept header and return a list of available types in preferred order. If a type is unacceptable, it will not be in the resulting list. This is a convenience wrapper around matchTypes and parseAcceptHeader. (str, [str]) -> [str] |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0alpha3 on Fri Dec 8 13:17:17 2006 | http://epydoc.sourceforge.net |