Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Deep Learning avec Python
et Keras et Tensorflow
Voir le programme détaillé
Classe « Request »

Méthode flask.wrappers.Request.get_json

Signature de la méthode get_json

def get_json(self, force: 'bool' = False, silent: 'bool' = False, cache: 'bool' = True) -> 't.Any | None' 

Description

help(Request.get_json)

Parse :attr:`data` as JSON.

If the mimetype does not indicate JSON
(:mimetype:`application/json`, see :attr:`is_json`), or parsing
fails, :meth:`on_json_loading_failed` is called and
its return value is used as the return value. By default this
raises a 415 Unsupported Media Type resp.

:param force: Ignore the mimetype and always try to parse JSON.
:param silent: Silence mimetype and parsing errors, and
    return ``None`` instead.
:param cache: Store the parsed JSON to return for subsequent
    calls.

.. versionchanged:: 2.3
    Raise a 415 error instead of 400.

.. versionchanged:: 2.1
    Raise a 400 error if the content type is incorrect.


Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les fondamentaux
Voir le programme détaillé