The request object used by default in Flask. Remembers the
matched endpoint and view arguments.
Attributes
| Attribute | Type | Description |
|---|
| json_module | t.Any = json | The module used for JSON serialization and deserialization, defaulting to the standard library json module. |
| url_rule | `Rule | None` = None |
| view_args | `dict[str, t.Any] | None` = None |
| routing_exception | `HTTPException | None` = None |
Constructor
Signature
Methods
max_content_length()
@classmethod
def max_content_length() - > int | None
The maximum number of bytes that will be read during this request. If this limit is exceeded, a 413 :exc:~werkzeug.exceptions.RequestEntityTooLarge error is raised.
Returns
max_content_length()
@classmethod
def max_content_length(
value: int | None
) - > None
Sets the maximum number of bytes that will be read during this specific request.
Parameters
| Name | Type | Description |
|---|
| value | `int | None` |
Returns
@classmethod
def max_form_memory_size() - > int | None
The maximum size in bytes any non-file form field may be in a multipart/form-data body. If this limit is exceeded, a 413 :exc:~werkzeug.exceptions.RequestEntityTooLarge error is raised.
Returns
@classmethod
def max_form_memory_size(
value: int | None
) - > None
Sets the maximum size in bytes any non-file form field may be for this specific request.
Parameters
| Name | Type | Description |
|---|
| value | `int | None` |
Returns
@classmethod
def max_form_parts() - > int | None
The maximum number of fields that may be present in a multipart/form-data body. If this limit is exceeded, a 413 :exc:~werkzeug.exceptions.RequestEntityTooLarge error is raised.
Returns
@classmethod
def max_form_parts(
value: int | None
) - > None
Sets the maximum number of fields allowed in a multipart form body for this specific request.
Parameters
| Name | Type | Description |
|---|
| value | `int | None` |
Returns
endpoint()
@classmethod
def endpoint() - > str | None
The endpoint that matched the request URL. This will be None if matching failed or has not been performed yet.
Returns
blueprint()
@classmethod
def blueprint() - > str | None
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.
Returns
blueprints()
@classmethod
def blueprints() - > list[str]
The registered names of the current blueprint upwards through parent blueprints.
Returns
| Type | Description |
|---|
list[str] | A list of blueprint names starting from the current one up to the root. |
on_json_loading_failed()
@classmethod
def on_json_loading_failed(
e: ValueError | None
) - > t.Any
Handles failures during JSON parsing, raising a BadRequest exception or re-raising the original error if the application is in debug mode.
Parameters
| Name | Type | Description |
|---|
| e | `ValueError | None` |
Returns
| Type | Description |
|---|
t.Any | The result of the parent class's failure handler, or raises an exception. |