Skip to content

Commit de25e98

Browse files
miguelgrinbergdavidism
authored andcommitted
minor rewording of get_json documentation for clarity (pallets#1781)
1 parent 317d603 commit de25e98

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

flask/wrappers.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,12 @@ def is_json(self):
123123
return False
124124

125125
def get_json(self, force=False, silent=False, cache=True):
126-
"""Parses the incoming JSON request data and returns it. If
127-
parsing fails the :meth:`on_json_loading_failed` method on the
128-
request object will be invoked. By default this function will
129-
only load the json data if the mimetype is :mimetype:`application/json`
130-
but this can be overridden by the `force` parameter.
126+
"""Parses the incoming JSON request data and returns it. By default
127+
this function will return ``None`` if the mimetype is not
128+
:mimetype:`application/json` but this can be overridden by the
129+
``force`` parameter. If parsing fails the
130+
:meth:`on_json_loading_failed` method on the request object will be
131+
invoked.
131132
132133
:param force: if set to ``True`` the mimetype is ignored.
133134
:param silent: if set to ``True`` this method will fail silently

0 commit comments

Comments
 (0)