路径参数
# 单一参数
@app.get('/index/{id}')
def index(id: int):
return {"message": "success", "data": id}
# 多参数
@app.get('/index/{username}/{id}')
def index(username:str, id: int):
return {"message": "success", "username": username, "id":id}
-------------------------------------------
个性签名:代码过万,键盘敲烂!!!