Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for RedirectResponse (0.18 sec)

  1. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 10 16:22:47 GMT 2023
    - 384 bytes
    - Viewed (0)
Back to top