Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for RedirectResponse (0.32 sec)

  1. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 237 bytes
    - Viewed (0)
  2. docs/de/docs/reference/responses.md

    Sie können diese direkt von `fastapi.responses` importieren:
    
    ```python
    from fastapi.responses import (
        FileResponse,
        HTMLResponse,
        JSONResponse,
        ORJSONResponse,
        PlainTextResponse,
        RedirectResponse,
        Response,
        StreamingResponse,
        UJSONResponse,
    )
    ```
    
    ## FastAPI-Responses
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Feb 19 15:53:39 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  3. docs/en/docs/reference/responses.md

    You can import them directly from `fastapi.responses`:
    
    ```python
    from fastapi.responses import (
        FileResponse,
        HTMLResponse,
        JSONResponse,
        ORJSONResponse,
        PlainTextResponse,
        RedirectResponse,
        Response,
        StreamingResponse,
        UJSONResponse,
    )
    ```
    
    ## FastAPI Responses
    
    There are a couple of custom FastAPI response classes, you can use them to optimize JSON performance.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 3.7K bytes
    - Viewed (0)
  4. docs/de/docs/advanced/custom-response.md

    ```
    
    !!! tip "Tipp"
        Möglicherweise ist `ORJSONResponse` eine schnellere Alternative.
    
    ### `RedirectResponse`
    
    Gibt eine HTTP-Weiterleitung (HTTP-Redirect) zurück. Verwendet standardmäßig den Statuscode 307 – Temporäre Weiterleitung (Temporary Redirect).
    
    Sie können eine `RedirectResponse` direkt zurückgeben:
    
    ```Python hl_lines="2  9"
    {!../../../docs_src/custom_response/tutorial006.py!}
    ```
    
    ---
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 23 13:05:12 GMT 2024
    - 13.5K bytes
    - Viewed (0)
  5. docs/en/docs/advanced/custom-response.md

    {!../../../docs_src/custom_response/tutorial001.py!}
    ```
    
    !!! tip
        It's possible that `ORJSONResponse` might be a faster alternative.
    
    ### `RedirectResponse`
    
    Returns an HTTP redirect. Uses a 307 status code (Temporary Redirect) by default.
    
    You can return a `RedirectResponse` directly:
    
    ```Python hl_lines="2  9"
    {!../../../docs_src/custom_response/tutorial006.py!}
    ```
    
    ---
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.7K bytes
    - Viewed (0)
  6. 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 Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17.9K bytes
    - Viewed (0)
  7. fastapi/routing.py

                    Read more about it in the
                    [FastAPI docs for Custom Response - HTML, Stream, File, others](https://fastapi.tiangolo.com/advanced/custom-response/#redirectresponse).
                    """
                ),
            ] = Default(JSONResponse),
            name: Annotated[
                Optional[str],
                Doc(
                    """
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 170.1K bytes
    - Viewed (0)
  8. docs/de/docs/tutorial/response-model.md

    ```
    
    Dieser einfache Anwendungsfall wird automatisch von FastAPI gehandhabt, weil die Annotation des Rückgabetyps die Klasse (oder eine Unterklasse von) `Response` ist.
    
    Und Tools werden auch glücklich sein, weil sowohl `RedirectResponse` als auch `JSONResponse` Unterklassen von `Response` sind, die Typannotation ist daher korrekt.
    
    ### Eine Unterklasse von Response annotieren
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 20:26:58 GMT 2024
    - 19.9K bytes
    - Viewed (0)
  9. docs/ru/docs/tutorial/response-model.md

    ```
    
    Это поддерживается FastAPI по-умолчанию, т.к. аннотация проставлена в классе (или подклассе) `Response`.
    
    И ваши помощники разработки также будут счастливы, т.к. оба класса `RedirectResponse` и `JSONResponse` являются подклассами `Response`. Таким образом мы получаем корректную аннотацию типа.
    
    ### Подкласс Response в аннотации типа
    
    Вы также можете указать подкласс `Response` в аннотации типа:
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 30.5K bytes
    - Viewed (0)
  10. docs/em/docs/tutorial/response-model.md

    ```
    
    👉 🙅 💼 🍵 🔁 FastAPI ↩️ 📨 🆎 ✍ 🎓 (⚖️ 🏿) `Response`.
    
    & 🧰 🔜 😄 ↩️ 👯‍♂️ `RedirectResponse` & `JSONResponse` 🏿 `Response`, 🆎 ✍ ☑.
    
    ### ✍ 📨 🏿
    
    👆 💪 ⚙️ 🏿 `Response` 🆎 ✍:
    
    ```Python hl_lines="8-9"
    {!> ../../../docs_src/response_model/tutorial003_03.py!}
    ```
    
    👉 🔜 👷 ↩️ `RedirectResponse` 🏿 `Response`, & FastAPI 🔜 🔁 🍵 👉 🙅 💼.
    
    ### ❌ 📨 🆎 ✍
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 16K bytes
    - Viewed (0)
Back to top