Custom Request and APIRoute class
https://fastapi.tiangolo.com/how-to/custom-request-and-route/
#FastAPI
In some cases, you may want to override the logic used by the Request and APIRoute classes.
In particular, this may be a good alternative to logic in a middleware.
Middleware (FastAPI Tutorial)
For example, if you want to read or manipulate the request body before it is processed by your application.
Use cases
Automatically logging all request bodies.
IMO:特定のエンドポイントにだけ適用できるミドルウェア(ミドルウェアは全体に影響)