mirror of
https://github.com/fastapi/fastapi.git
synced 2026-07-14 17:03:09 -04:00
📝 Add request body tutorial
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from fastapi import Body, FastAPI
|
||||
from pydantic import BaseModel, Schema
|
||||
from pydantic import BaseModel
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ app = FastAPI()
|
||||
|
||||
|
||||
@app.get("/users/{user_id}/items/{item_id}")
|
||||
async def read_user_item(
|
||||
user_id: int, item_id: str, needy: str
|
||||
):
|
||||
async def read_user_item(user_id: int, item_id: str, needy: str):
|
||||
item = {"item_id": item_id, "owner_id": user_id, "needy": needy}
|
||||
return item
|
||||
|
||||
Reference in New Issue
Block a user