quart.wrappers.base module¶
-
class
quart.wrappers.base.
BaseRequestWebsocket
(method: str, scheme: str, path: str, query_string: bytes, headers: werkzeug.datastructures.Headers, root_path: str, http_version: str)¶ Bases:
quart.wrappers.base._BaseRequestResponse
This class is the basis for Requests and websockets..
-
routing_exception
¶ If an exception is raised during the route matching it will be stored here.
-
url_rule
¶ The rule that this request has been matched too.
-
view_args
¶ The keyword arguments for the view from the route matching.
-
property
accept_charsets
¶
-
property
accept_encodings
¶
-
property
accept_languages
¶
-
property
accept_mimetypes
¶
-
property
access_control_request_headers
¶
-
property
access_control_request_method
¶
-
property
access_route
¶
-
property
base_url
¶ Returns the base url without query string or fragments.
-
property
blueprint
¶ Returns the blueprint the matched endpoint belongs to.
This can be None if the request has not been matched or the endpoint is not in a blueprint.
-
property
cache_control
¶
The parsed cookies attached to this request.
-
property
date
¶
-
dict_storage_class
¶ alias of
werkzeug.datastructures.ImmutableMultiDict
-
encoding_errors
= 'replace'¶
-
property
endpoint
¶ Returns the corresponding endpoint matched for this request.
This can be None if the request has not been matched with a rule.
-
property
full_path
¶
-
property
host
¶
-
property
host_url
¶
-
property
if_match
¶
-
property
if_modified_since
¶
-
property
if_none_match
¶
-
property
if_range
¶
-
property
if_unmodified_since
¶
-
property
is_secure
¶
-
list_storage_class
¶ alias of
werkzeug.datastructures.ImmutableList
-
property
max_forwards
¶
-
property
origin
¶
-
parameter_storage_class
¶ alias of
werkzeug.datastructures.ImmutableMultiDict
-
property
pragma
¶
-
property
range
¶
-
property
referrer
¶
-
property
remote_addr
¶ Returns the remote address of the request, faked into the headers.
-
routing_exception
: Optional[Exception] = None
-
property
url
¶ Returns the full url requested.
-
property
url_root
¶
-
url_rule
: Optional['QuartRule'] = None
-
view_args
: Optional[Dict[str, Any]] = None
-
-
class
quart.wrappers.base.
JSONMixin
¶ Bases:
object
Mixin to provide get_json methods from objects.
The class must support _load_data_json and have a mimetype attribute.
-
async
get_json
(force: bool = False, silent: bool = False, cache: bool = True) → Any¶ Parses the body data as JSON and returns it.
- Parameters
force – Force JSON parsing even if the mimetype is not JSON.
silent – Do not trigger error handling if parsing fails, without this the
on_json_loading_failed()
will be called on error.cache – Cache the parsed JSON on this request object.
-
property
is_json
¶ Returns True if the content_type is json like.
-
property
json
¶
-
property
mimetype
¶ Return the mimetype of the associated data.
-
on_json_loading_failed
(error: Exception) → None¶ Handle a JSON parsing error.
- Parameters
error – The exception raised during parsing.
-
async