[FastAPI-19]响应状态码
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
}