docs: clarify 415 error when receiving JSON requests
This commit is contained in:
parent
2579ce9f18
commit
983d271d8a
1 changed files with 12 additions and 0 deletions
|
|
@ -715,6 +715,18 @@ serialization library to convert the data to valid JSON types first.
|
|||
There are many serialization libraries and Flask API extensions
|
||||
maintained by the community that support more complex applications.
|
||||
|
||||
.. note::
|
||||
|
||||
When receiving JSON data in a request, Flask expects the
|
||||
``Content-Type`` header to be set to ``application/json``.
|
||||
If the header is missing, incorrect, or the request body contains
|
||||
invalid JSON, Flask may respond with a **415 Unsupported Media Type**
|
||||
error.
|
||||
|
||||
To avoid this, ensure that clients send valid JSON and include the
|
||||
correct ``Content-Type`` header when making requests.
|
||||
|
||||
|
||||
|
||||
.. _sessions:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue