Files
fastapi__fastapi/docs/src/response_status_code/tutorial002.py
T

9 lines
173 B
Python
Raw Normal View History

from fastapi import FastAPI, status
app = FastAPI()
@app.post("/items/", status_code=status.HTTP_201_CREATED)
async def create_item(name: str):
return {"name": name}