class documentation

class Request(RequestBase):

View In Hierarchy

The request object used by default in Flask. Remembers the matched endpoint and view arguments.

It is what ends up as ~flask.request. If you want to replace the request object used you can subclass this and set ~flask.Flask.request_class to your subclass.

The request object is a ~werkzeug.wrappers.Request subclass and provides all of the attributes Werkzeug defines plus a few Flask specific ones.

Method ​_load​_form​_data Undocumented
Method on​_json​_loading​_failed Undocumented
Class Variable routing​_exception Undocumented
Class Variable url​_rule Undocumented
Class Variable view​_args Undocumented
Property blueprint The registered name of the current blueprint.
Property blueprints The registered names of the current blueprint upwards through parent blueprints.
Property endpoint The endpoint that matched the request URL.
Property max​_content​_length Read-only view of the MAX_CONTENT_LENGTH config key.
def _load_form_data(self):

Undocumented

def on_json_loading_failed(self, e):

Undocumented

Parameters
e:ExceptionUndocumented
Returns
te.NoReturnUndocumented
routing_exception: t.Optional[Exception] =

Undocumented

url_rule: t.Optional[Rule] =

Undocumented

view_args: t.Optional[t.Dict[str, t.Any]] =

Undocumented

@property
blueprint: t.Optional[str] =

The registered name of the current blueprint.

This will be None if the endpoint is not part of a blueprint, or if URL matching failed or has not been performed yet.

This does not necessarily match the name the blueprint was created with. It may have been nested, or registered with a different name.

@property
blueprints: t.List[str] =

The registered names of the current blueprint upwards through parent blueprints.

This will be an empty list if there is no current blueprint, or if URL matching failed.

New in version 2.0.1.
@property
endpoint: t.Optional[str] =

The endpoint that matched the request URL.

This will be None if matching failed or has not been performed yet.

This in combination with view_args can be used to reconstruct the same URL or a modified URL.

@property
max_content_length: t.Optional[int] =
Read-only view of the MAX_CONTENT_LENGTH config key.