FastAPI path operations
Routes, methods and responses
A FastAPI app maps an HTTP method and a path to a Python function. @app.get("/plots/current") answers GET on that path. FastAPI itself answers 405 when a known path gets another method and 404 for a path it does not know, and it turns the value you return into JSON. Each exercise builds its own app and sends requests through HTTPX’s ASGITransport, so you see the real status codes and bodies without starting a server.
What runs in the browser
The exercises run FastAPI 0.136.1, Pydantic 2.12.5 and HTTPX 0.28.1 on a Python runtime in your browser. Handlers use async def, because synchronous routes need a thread pool the browser does not have. The FastAPI tutorial shows how to run the same code under a server such as Uvicorn. The next lessons in the unit add path and query validation, Pydantic request models, response models and HTTP errors.