- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 24 for RedirectResponse (0.3 sec)
-
docs_src/custom_response/tutorial006b.py
from fastapi import FastAPI from fastapi.responses import RedirectResponse app = FastAPI() @app.get("/fastapi", response_class=RedirectResponse) async def redirect_fastapi():
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Jul 03 19:51:28 GMT 2021 - 220 bytes - Viewed (0) -
docs_src/response_model/tutorial003_05_py310.py
from fastapi import FastAPI, Response from fastapi.responses import RedirectResponse app = FastAPI() @app.get("/portal", response_model=None) async def get_portal(teleport: bool = False) -> Response | dict: if teleport: return RedirectResponse(url="https://www.youtube.com/watch?v=dQw4w9WgXcQ")
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Jan 10 16:22:47 GMT 2023 - 373 bytes - Viewed (0) -
docs_src/response_model/tutorial003_03.py
from fastapi import FastAPI from fastapi.responses import RedirectResponse app = FastAPI() @app.get("/teleport") async def get_teleport() -> RedirectResponse:
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Jan 10 16:22:47 GMT 2023 - 241 bytes - Viewed (0) -
docs/en/docs/tutorial/response-model.md
And tools will also be happy because both `RedirectResponse` and `JSONResponse` are subclasses of `Response`, so the type annotation is correct. ### Annotate a Response Subclass You can also use a subclass of `Response` in the type annotation: ```Python hl_lines="8-9" {!> ../../../docs_src/response_model/tutorial003_03.py!} ```
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 17.9K bytes - Viewed (0) -
docs_src/custom_response/tutorial006c.py
from fastapi import FastAPI from fastapi.responses import RedirectResponse app = FastAPI() @app.get("/pydantic", response_class=RedirectResponse, status_code=302) async def redirect_pydantic():
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 237 bytes - Viewed (0) -
docs_src/response_model/tutorial003_04.py
from typing import Union from fastapi import FastAPI, Response from fastapi.responses import RedirectResponse app = FastAPI() @app.get("/portal") async def get_portal(teleport: bool = False) -> Union[Response, dict]: if teleport: return RedirectResponse(url="https://www.youtube.com/watch?v=dQw4w9WgXcQ")
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Jan 10 16:22:47 GMT 2023 - 384 bytes - Viewed (0) -
docs_src/custom_response/tutorial006.py
from fastapi import FastAPI from fastapi.responses import RedirectResponse app = FastAPI() @app.get("/typer") async def redirect_typer():
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Jul 03 19:51:28 GMT 2021 - 199 bytes - Viewed (0) -
docs_src/response_model/tutorial003_04_py310.py
from fastapi import FastAPI, Response from fastapi.responses import RedirectResponse app = FastAPI() @app.get("/portal") async def get_portal(teleport: bool = False) -> Response | dict: if teleport: return RedirectResponse(url="https://www.youtube.com/watch?v=dQw4w9WgXcQ")
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Jan 10 16:22:47 GMT 2023 - 352 bytes - Viewed (0) -
docs_src/response_model/tutorial003_02.py
from fastapi import FastAPI, Response from fastapi.responses import JSONResponse, RedirectResponse app = FastAPI() @app.get("/portal") async def get_portal(teleport: bool = False) -> Response: if teleport: return RedirectResponse(url="https://www.youtube.com/watch?v=dQw4w9WgXcQ")
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Jan 10 16:22:47 GMT 2023 - 381 bytes - Viewed (0) -
docs_src/response_model/tutorial003_05.py
from typing import Union from fastapi import FastAPI, Response from fastapi.responses import RedirectResponse app = FastAPI() @app.get("/portal", response_model=None) async def get_portal(teleport: bool = False) -> Union[Response, dict]: if teleport: return RedirectResponse(url="https://www.youtube.com/watch?v=dQw4w9WgXcQ")
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Jan 10 16:22:47 GMT 2023 - 405 bytes - Viewed (0)