FastAPI میں، ایک path operation ایک route ہے — ایک function جو HTTP method decorator (@app.get, @app.post, وغیرہ) سے سجایا گیا ہو جو ایک path پر requests کو سنبھالتا ہے۔ Function کی return value خود بخود JSON میں serialize ہو جاتی ہے۔
ہر HTTP method کے لیے routes define کرنا
fastapi FastAPI
app = FastAPI()
():
[{: }, {: }]
():
{: item_id}
():
item
():
{: item_id}
