Browse Source

minor rewording of get_json documentation for clarity (#1781)

pull/1797/head
Miguel Grinberg 9 years ago committed by David Lord
parent
commit
de25e98f91
  1. 11
      flask/wrappers.py

11
flask/wrappers.py

@ -123,11 +123,12 @@ class Request(RequestBase):
return False return False
def get_json(self, force=False, silent=False, cache=True): def get_json(self, force=False, silent=False, cache=True):
"""Parses the incoming JSON request data and returns it. If """Parses the incoming JSON request data and returns it. By default
parsing fails the :meth:`on_json_loading_failed` method on the this function will return ``None`` if the mimetype is not
request object will be invoked. By default this function will :mimetype:`application/json` but this can be overridden by the
only load the json data if the mimetype is :mimetype:`application/json` ``force`` parameter. If parsing fails the
but this can be overridden by the `force` parameter. :meth:`on_json_loading_failed` method on the request object will be
invoked.
:param force: if set to ``True`` the mimetype is ignored. :param force: if set to ``True`` the mimetype is ignored.
:param silent: if set to ``True`` this method will fail silently :param silent: if set to ``True`` this method will fail silently

Loading…
Cancel
Save