docs: clarify 415 vs 400 errors for request.json
Distinguish between 415 Unsupported Media Type (wrong Content-Type) and 400 Bad Request (invalid JSON body) to align with API documentation. Fixes #58254
This commit is contained in:
parent
d52f0228d9
commit
3962683c5b
1 changed files with 2 additions and 1 deletions
|
|
@ -136,7 +136,8 @@ In general, prefer sending request data as form data, as would be used
|
||||||
when submitting an HTML form. JSON can represent more complex data, but
|
when submitting an HTML form. JSON can represent more complex data, but
|
||||||
unless you need that it's better to stick with the simpler format. When
|
unless you need that it's better to stick with the simpler format. When
|
||||||
sending JSON data, the ``Content-Type: application/json`` header must be
|
sending JSON data, the ``Content-Type: application/json`` header must be
|
||||||
sent as well, otherwise Flask will return a 400 error.
|
sent as well, otherwise Flask will return a 415 Unsupported Media Type
|
||||||
|
error.
|
||||||
|
|
||||||
.. code-block:: javascript
|
.. code-block:: javascript
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue