Index of the httpencode module
-
m
httpencode
...
- The httpencode package exports these for getting formatters:
-
m
wrappers
...
- Lazy serialization and decoding wrappers for app_iter and wsgi.input
objects
- C FileAppIterWrapper ... - Wraps a WSGI app_iter and presents a file-like interface to it.
- C ReplacementInput ... - A replacement for a wsgi.input file that acts as a file, but lazily serializes the data. Also, the data can be retrieved without serialization.
- C LazySerialize ... - Iterator that serializes the data lazily, and returns the data as an iterator, but also allows the data to be retrieved without serialization.
- C FileLengthWrapper ... - Wraps a file-like object that has a fixed length, returning '' after the object has been exhausted.
- m etree ...
-
m
form
...
- a pyform ...
- a form ...
- f dump_form_iter ...
- f load_form ...
- f dump_pyform_iter ...
- f load_pyform ...
-
m
format
...
- Implements Format objects, which represent different formats and
serializations. Concrete implementations instantiate Format.
-
C
Format
...
- Instances of this class represent some particular format. This is
the entry point for both response and request handling for the
format.
- f parse_request ... - Takes the WSGI environment and parses the request for this format, possibly using a shortcut to avoid decoding.
- f choose_mimetype ...
- f responder ... - Returns a WSGI application that serves the given data, with an optional explicit content_type and optional additional headers.
- f parse_wsgi_response ... - Parses the app_iter.
- f parse_response ... - Parses the HTTPResponse-like object
-
f
__init__
...
-
- name:
- A nice readable name for the format.
- f make_wsgi_input_length ...
- C RPCResponder ...
-
C
Format
...
- Instances of this class represent some particular format. This is
the entry point for both response and request handling for the
format.
-
m
mimeparse
...
- MIME-Type Parser
- a __credits__ ...
- a __email__ ...
- f best_match ... - Takes a list of supported mime-types and finds the best match for all the media-ranges listed in header. The value of header must be a string that conforms to the format of the HTTP Accept: header. The value of 'supported' is a list of mime-types.
- f quality_parsed ... - Find the best match for a given mime_type against a list of media_ranges that have already been parsed by parse_media_range(). Returns the 'q' quality parameter of the best match, 0 if no match was found. This function bahaves the same as quality() except that 'parsed_ranges' must be a list of parsed media ranges.
- f parse_mime_type ... - Carves up a mime_type and returns a tuple of the (type, subtype, params) where 'params' is a dictionary of all the parameters for the media range. For example, the media range 'application/xhtml;q=0.5' would get parsed into:
-
f
parse_media_range
...
-
Carves up a media range and returns a tuple of the (type, subtype, params) where 'params' is a dictionary of all the parameters for the media range. For example, the media range 'application/*;q=0.5' would get parsed into:
- f quality ... - Returns the quality 'q' of a mime_type when compared against the media-ranges in ranges. For example:
-
m
http
...
-
C
HTTP
...
- a default_encoding ...
- a mock_wsgi_app ...
- a default_post_input_type ...
- a redirections ...
- a prefer_input_mimetypes ...
- f __init__ ...
- f GET ...
- f clone ... - Create another HTTP instance with the same settings as the current one, but potentially overriding some settings.
- f POST ...
- f request ...
- f PUT ...
- f DELETE ...
-
C
HTTP
...
- m json ...
-
m
api
...
- a ACCEPT ...
- C Responder ... - WSGI application that serves a specific piece of data. The data should not be mutated after creating this application.
-
C
InsecureFormatError
...
- Raised when for some reason an insecure format is used in a
non-trusted situation.
- f get_mimetype_from_environ ... - Get the mimetype from the WSGI environ
- f parse_request ... - Parses a WSGI request, attempting to get the given output type.
- f get_mimetype_from_headers ...
- f parse_response ... - Parses an HTTPResponse, attempting to get the given output type.
- f get_mimetype_from_response ... - Get the mimetype from the HTTP response
-
m
registry
...
- Finds formats given criteria or name.
-
C
NoFormatError
...
- Raised when no matching format can be found
- f get_format ... - Gets a format object by name
- f find_format_match ... - Find a format object that can accept the given mimetype and produce the given type.
-
C
NoFormatError
...
- Raised when no matching format can be found
- m lxmlformat ... - Parses XML and HTML to lxml nodes
- m bsoupfilter ...
-
m
wrappers
...
- Lazy serialization and decoding wrappers for app_iter and wsgi.input
objects