Search Options

Results per page
Sort
Preferred Languages
Advance

Results 541 - 550 of 659 for status_code (0.14 sec)

  1. tests/main.py

        return f"foo bar {query}"
    
    
    @app.get("/query/param-required/int")
    def get_query_param_required_type(query: int = Query()):
        return f"foo bar {query}"
    
    
    @app.get("/enum-status-code", status_code=http.HTTPStatus.CREATED)
    def get_enum_status_code():
        return "foo bar"
    
    
    @app.get("/query/frozenset")
    def get_query_type_frozenset(query: FrozenSet[int] = Query(...)):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 21:56:59 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  2. docs/en/docs/advanced/custom-response.md

    {!../../docs_src/custom_response/tutorial006b.py!}
    ```
    
    If you do that, then you can return the URL directly from your *path operation* function.
    
    In this case, the `status_code` used will be the default one for the `RedirectResponse`, which is `307`.
    
    ---
    
    You can also use the `status_code` parameter combined with the `response_class` parameter:
    
    ```Python hl_lines="2  7  9"
    {!../../docs_src/custom_response/tutorial006c.py!}
    ```
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 12K bytes
    - Viewed (0)
  3. docs/pt/docs/advanced/custom-response.md

    ```
    
    Se você fizer isso, então você pode retornar a URL diretamente da sua *função de operação de rota*
    
    Neste caso, o `status_code` utilizada será o padrão de `RedirectResponse`, que é `307`.
    
    ---
    
    Você também pode utilizar o parâmetro `status_code` combinado com o parâmetro `response_class`:
    
    ```Python hl_lines="2  7  9"
    {!../../docs_src/custom_response/tutorial006c.py!}
    ```
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Oct 29 11:47:10 UTC 2024
    - 13.5K bytes
    - Viewed (0)
  4. tests/test_dependency_class.py

            ("/asynchronous-method-gen-dependency", "asynchronous-method-gen-dependency"),
        ],
    )
    def test_class_dependency(route, value):
        response = client.get(route, params={"value": value})
        assert response.status_code == 200, response.text
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Aug 09 10:54:05 UTC 2020
    - 3.3K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_websockets/test_tutorial002_an_py310.py

        from docs_src.websockets.tutorial002_an_py310 import app
    
        return app
    
    
    @needs_py310
    def test_main(app: FastAPI):
        client = TestClient(app)
        response = client.get("/")
        assert response.status_code == 200, response.text
        assert b"<!DOCTYPE html>" in response.content
    
    
    @needs_py310
    def test_websocket_with_cookie(app: FastAPI):
        client = TestClient(app, cookies={"session": "fakesession"})
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 3.9K bytes
    - Viewed (0)
  6. docs/em/docs/advanced/additional-status-codes.md

    🖼, ➡️ 💬 👈 👆 💚 ✔️ *➡ 🛠️* 👈 ✔ ℹ 🏬, &amp; 📨 🇺🇸🔍 👔 📟 2️⃣0️⃣0️⃣ "👌" 🕐❔ 🏆.
    
    ✋️ 👆 💚 ⚫️ 🚫 🆕 🏬. &amp; 🕐❔ 🏬 🚫 🔀 ⏭, ⚫️ ✍ 👫, &amp; 📨 🇺🇸🔍 👔 📟 2️⃣0️⃣1️⃣ "✍".
    
    🏆 👈, 🗄 `JSONResponse`, &amp; 📨 👆 🎚 📤 🔗, ⚒ `status_code` 👈 👆 💚:
    
    ```Python hl_lines="4  25"
    {!../../docs_src/additional_status_codes/tutorial001.py!}
    ```
    
    /// warning
    
    🕐❔ 👆 📨 `Response` 🔗, 💖 🖼 🔛, ⚫️ 🔜 📨 🔗.
    
    ⚫️ 🏆 🚫 🎻 ⏮️ 🏷, ♒️.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  7. docs/ru/docs/tutorial/path-operation-configuration.md

    /// warning | "Внимание"
    
    Помните, что эти параметры передаются непосредственно *декоратору операций пути*, а не вашей *функции-обработчику операций пути*.
    
    ///
    
    ## Коды состояния
    
    Вы можете определить (HTTP) `status_code`, который будет использован в ответах вашей *операции пути*.
    
    Вы можете передать только `int`-значение кода, например `404`.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 7.9K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/path-operation-configuration.md

    /// warning
    
    Notice that these parameters are passed directly to the *path operation decorator*, not to your *path operation function*.
    
    ///
    
    ## Response Status Code
    
    You can define the (HTTP) `status_code` to be used in the response of your *path operation*.
    
    You can pass directly the `int` code, like `404`.
    
    But if you don't remember what each number code is for, you can use the shortcut constants in `status`:
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_websockets/test_tutorial002_an.py

    from fastapi.websockets import WebSocketDisconnect
    
    from docs_src.websockets.tutorial002_an import app
    
    
    def test_main():
        client = TestClient(app)
        response = client.get("/")
        assert response.status_code == 200, response.text
        assert b"<!DOCTYPE html>" in response.content
    
    
    def test_websocket_with_cookie():
        client = TestClient(app, cookies={"session": "fakesession"})
        with pytest.raises(WebSocketDisconnect):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 3.6K bytes
    - Viewed (0)
  10. docs/ko/docs/advanced/response-change-status-code.md

    이런 경우에는 `Response` 파라미터를 사용할 수 있습니다.
    
    ## `Response` 파라미터 사용하기
    
    *경로 작동 함수*에 `Response` 타입의 파라미터를 선언할 수 있습니다. (쿠키와 헤더에 대해 선언하는 것과 유사하게)
    
    그리고 이 *임시* 응답 객체에서 `status_code`를 설정할 수 있습니다.
    
    ```Python hl_lines="1  9  12"
    {!../../docs_src/response_change_status_code/tutorial001.py!}
    ```
    
    그리고 평소처럼 원하는 객체(`dict`, 데이터베이스 모델 등)를 반환할 수 있습니다.
    
    `response_model`을 선언했다면 반환된 객체는 여전히 필터링되고 변환됩니다.
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 22:01:39 UTC 2024
    - 1.8K bytes
    - Viewed (0)
Back to top