From 872f1ba54e88adfdfc570f768b3d0485326822e0 Mon Sep 17 00:00:00 2001 From: Samarth Date: Wed, 8 Oct 2025 18:42:48 +0530 Subject: [PATCH] docs: clarify JSON parsing error conditions in Flask views --- docs/patterns/javascript.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/patterns/javascript.rst b/docs/patterns/javascript.rst index d58a3eb6..64eb6966 100644 --- a/docs/patterns/javascript.rst +++ b/docs/patterns/javascript.rst @@ -244,8 +244,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. +the body is not valid JSON, or if parsing fails for any reason (including +a missing or incorrect ``Content-Type`` header), a 400 Bad Request error +will be raised. .. code-block:: python