fix: Clarify Request.json error handling
Fixes #5825 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
2579ce9f18
commit
f2cd7aa967
1 changed files with 1 additions and 1 deletions
|
|
@ -245,7 +245,7 @@ Receiving JSON in Views
|
||||||
Use the :attr:`~flask.Request.json` property of the
|
Use the :attr:`~flask.Request.json` property of the
|
||||||
:data:`~flask.request` object to decode the request's body as JSON. If
|
:data:`~flask.request` object to decode the request's body as JSON. If
|
||||||
the body is not valid JSON, or the ``Content-Type`` header is not set to
|
the body is not valid JSON, or the ``Content-Type`` header is not set to
|
||||||
``application/json``, a 400 Bad Request error will be raised.
|
``application/json``, A 415 Unsupported Media Type error will be raised instead.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue