1 Star 0 Fork 74

it老头/FastAPI

forked from Gitee 极速下载/FastAPI 
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
tutorial006.py 321 Bytes
一键复制 编辑 原始数据 按行查看 历史
from fastapi import Depends, FastAPI
from fastapi.security import HTTPBasic, HTTPBasicCredentials
app = FastAPI()
security = HTTPBasic()
@app.get("/users/me")
def read_current_user(credentials: HTTPBasicCredentials = Depends(security)):
return {"username": credentials.username, "password": credentials.password}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/redrice/FastAPI.git
git@gitee.com:redrice/FastAPI.git
redrice
FastAPI
FastAPI
master

搜索帮助