Home »
MCQs »
FastAPI MCQs
To create a middleware you use which decorator?
29. To create a middleware you use which decorator?
- @app.middleware("http")
- @app.middle_route("http").
- @app.middleware_engine("http").
Answer: A) @app.middleware("http")
Explanation:
To create a middleware you use the decorator @app.middleware("http").