Question · Cours Python · Module 6: Async et FastAPI

Le décorateur d'endpoint

Comment définit-on un endpoint GET dans FastAPI ?

Réponses possibles

  • @endpoint.get('/path')
  • @app.route('/path', methods=['GET'])
  • @get('/path')
  • @app.get('/path')

Tu vérifieras la bonne réponse en résolvant cet exercice dans le jeu CodeWorlds.