Allow setting the response_class to RedirectResponse and returning the URL from the function (#3457)

This commit is contained in:
Sebastián Ramírez
2021-07-03 21:51:28 +02:00
committed by GitHub
parent ea8d7f689e
commit dc5a966548
13 changed files with 226 additions and 29 deletions

View File

@@ -5,5 +5,5 @@ app = FastAPI()
@app.get("/typer")
async def read_typer():
async def redirect_typer():
return RedirectResponse("https://typer.tiangolo.com")