티스토리 뷰

공부

[FastApi] Bearer

승가비 2023. 9. 16. 22:29
728x90
from typing import Annotated
from fastapi import Depends
from fastapi.security import HTTPBearer, HTTPBasicCredentials

security = HTTPBearer()

@app.get("/api/v1/test")
def test(
    token: Annotated[HTTPBasicCredentials, Depends(security)],

https://stackoverflow.com/questions/70926257/how-to-pass-authorization-header-from-swagger-doc-in-python-fast-api

 

How to Pass Authorization Header from Swagger Doc in Python Fast API

I am trying to pass authorization header using Documentation page, similar to this page: Since, the documentations are automatic generated in Fast API, I am having hard time trying to figure this ...

stackoverflow.com

 

728x90
댓글