fastapi-master/docs_src/query_params/tutorial005.py

10 lines
192 B
Python
Raw Normal View History

2024-08-24 12:41:47 +08:00
from fastapi import FastAPI
app = FastAPI()
@app.get("/items/{item_id}")
async def read_user_item(item_id: str, needy: str):
item = {"item_id": item_id, "needy": needy}
return item