ใน FastAPI path operation คือ route — ฟังก์ชันที่ตกแต่งด้วย HTTP method decorator (@app.get, @app.post เป็นต้น) ที่จัดการคำขอไปยังเส้นทาง ค่าที่ส่งคืนของฟังก์ชันจะถูกแปลงเป็น JSON โดยอัตโนมัติ
กำหนด routes สำหรับแต่ละ HTTP method
fastapi FastAPI
app = FastAPI()
():
[{: }, {: }]
():
{: item_id}
():
item
():
{: item_id}
