utils.http package

Submodules

Module contents

class utils.http.HttpRequest[源代码]

基类:object

A basic HTTP request.

accepted_type(media_type)[源代码]

Return the MediaType instance which best matches the given media type.

accepted_types

Return a list of MediaType instances, in order of preference (quality).

accepted_types_by_precedence

Return a list of MediaType instances, in order of precedence (specificity).

accepts(media_type)[源代码]

Does the client accept a response in the given media type?

property body
build_absolute_uri(location=None)[源代码]

Build an absolute URI from the location and the variables available in this request. If no location is specified, build the absolute URI using request.get_full_path(). If the location is absolute, convert it to an RFC 3987 compliant URI and return it. If location is relative or is scheme-relative (i.e., //example.com/), urljoin() it to a base URL constructed from the request variables.

close()[源代码]
property encoding
get_full_path(force_append_slash=False)[源代码]
get_full_path_info(force_append_slash=False)[源代码]
get_host()[源代码]

Return the HTTP host using the environment or request headers.

get_port()[源代码]

Return the port number for the request as a string.

get_preferred_type(media_types)[源代码]

Select the preferred media type from the provided options.

Attempt to return a signed cookie. If the signature fails or the cookie has expired, raise an exception, unless the default argument is provided, in which case return that value.

headers
is_secure()[源代码]
parse_file_upload(META, post_data)[源代码]

Return a tuple of (POST QueryDict, FILES MultiValueDict).

read(*args, **kwargs)[源代码]
readline(*args, **kwargs)[源代码]
readlines()[源代码]
property scheme
property upload_handlers
utils.http.UserRequest

HttpRequest 的别名