flask.Request.get_json

Request.get_json(force=False, silent=False, cache=True)[source]

Parses the incoming JSON request data and returns it. By default this function will return None if the mimetype is not application/json but this can be overridden by the force parameter. If parsing fails the on_json_loading_failed() method on the request object will be invoked.

Parameters:
  • force – if set to True the mimetype is ignored.
  • silent – if set to True this method will fail silently and return None.
  • cache – if set to True the parsed JSON data is remembered on the request.