FastAPI berjalan di atas ASGI, jadi sebuah request melewati sebuah pipeline async: ASGI server menerimanya, middleware membungkusnya, router mencocokkan path, dependency diselesaikan, path operation Anda berjalan, dan nilai kembalian diserialisasi menjadi response.
Tahapannya
uvicorn (ASGI server)
│ scope + receive/send
▼
ASGI / Starlette middleware ── (CORS, GZip, custom)
▼
Routing ── cocokkan method + → operation
▼
Dependencies (Depends) ── selesaikan -deps, security, -setup
▼
Path operation 