mirror of
https://github.com/fastapi/fastapi.git
synced 2026-05-13 02:05:20 -04:00
📝 Update docs and examples for Response Model with Return Type Annotations, and update runtime error (#5873)
This commit is contained in:
committed by
GitHub
parent
6b83525ff4
commit
fb8e9083f4
9
docs_src/response_model/tutorial003_03.py
Normal file
9
docs_src/response_model/tutorial003_03.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from fastapi import FastAPI
|
||||
from fastapi.responses import RedirectResponse
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
@app.get("/teleport")
|
||||
async def get_teleport() -> RedirectResponse:
|
||||
return RedirectResponse(url="https://www.youtube.com/watch?v=dQw4w9WgXcQ")
|
||||
Reference in New Issue
Block a user