from fastapi import FastAPI,status
from pydantic import BaseModel
app = FastAPI()
'''
响应状态代码 status
'''
class User(BaseModel):
username : str
password : str
@app.post("/login",status_code=status.HTTP_200_OK)
def login(user : User):
return {
"username":user.username,
"password":user.password
}
标签:status,username,21,FastAPI,app,响应,user,password
From: https://www.cnblogs.com/leoshi/p/17250978.html