1 Star 0 Fork 74

一恒/FastAPI

forked from Gitee 极速下载/FastAPI 
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
tutorial003.py 310 Bytes
一键复制 编辑 原始数据 按行查看 历史
from fastapi import FastAPI
from pydantic import BaseModel
class Item(BaseModel):
name: str
description: str = None
price: float
tax: float = None
app = FastAPI()
@app.put("/items/{item_id}")
async def create_item(item_id: int, item: Item):
return {"item_id": item_id, **item.dict()}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/mvpred/FastAPI.git
git@gitee.com:mvpred/FastAPI.git
mvpred
FastAPI
FastAPI
master

搜索帮助