1 Star 0 Fork 75

fanpq/FastAPI

forked from Gitee 极速下载/FastAPI 
Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
tutorial006.py 321 Bytes
Copy Edit Raw Blame History
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/fanpq/FastAPI.git
git@gitee.com:fanpq/FastAPI.git
fanpq
FastAPI
FastAPI
master

Search