From 7185b6086de0a316e35ae2014c1b72b36e08f883 Mon Sep 17 00:00:00 2001 From: Soham-1616 Date: Mon, 29 Dec 2025 10:25:28 +0530 Subject: [PATCH] Clarify 415 Unsupported Media Type for invalid JSON Content-Type --- docs/patterns/javascript.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/patterns/javascript.rst b/docs/patterns/javascript.rst index d58a3eb6..15b1b8c5 100644 --- a/docs/patterns/javascript.rst +++ b/docs/patterns/javascript.rst @@ -243,9 +243,9 @@ Receiving JSON in Views ----------------------- Use the :attr:`~flask.Request.json` property of the -: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 -``application/json``, a 400 Bad Request error will be raised. +:data:`~flask.request` object to decode the request's body as JSON. If the ``Content-Type`` header is not set to ``application/json``, a +``415 Unsupported Media Type`` error will be returned. If the content type is +correct but the body is not valid JSON, a ``400 Bad Request`` error is raised. .. code-block:: python