Which of the following is a decorator used to specify a FastAPI route or endpoint?

27. Which of the following is a decorator used to specify a FastAPI route or endpoint? It is used to link a function to a certain HTTP request method (such as GET, POST, PUT, DELETE, and so on) and URL path.

  1. @app.router()
  2. @app.route_engine()
  3. @app.route()

Answer: C) @app.route()

Explanation:

@app.route() is a decorator used to specify a FastAPI route or endpoint. It is used to link a function to a certain HTTP request method (such as GET, POST, PUT, DELETE, and so on) and URL path.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.