Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 762 for respond (0.15 sec)

  1. docs/en/docs/tutorial/security/first-steps.md

    If it doesn't see an `Authorization` header, or the value doesn't have a `Bearer ` token, it will respond with a 401 status code error (`UNAUTHORIZED`) directly.
    
    You don't even have to check if the token exists to return an error. You can be sure that if your function is executed, it will have a `str` in that token.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 8.9K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/cors.md

    In this case the middleware will intercept the incoming request and respond with appropriate CORS headers, and either a `200` or `400` response for informational purposes.
    
    ### Simple requests
    
    Any request with an `Origin` header. In this case the middleware will pass the request through as normal, but will include appropriate CORS headers on the response.
    
    ## More info
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Nov 13 20:28:37 GMT 2022
    - 5.1K bytes
    - Viewed (0)
  3. docs/en/docs/advanced/websockets.md

    <img src="/img/tutorial/websockets/image01.png">
    
    You can type messages in the input box, and send them:
    
    <img src="/img/tutorial/websockets/image02.png">
    
    And your **FastAPI** application with WebSockets will respond back:
    
    <img src="/img/tutorial/websockets/image03.png">
    
    You can send (and receive) many messages:
    
    <img src="/img/tutorial/websockets/image04.png">
    
    And all of them will use the same WebSocket connection.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  4. docs/en/docs/tutorial/response-model.md

    ### `response_model` Priority
    
    If you declare both a return type and a `response_model`, the `response_model` will take priority and be used by FastAPI.
    
    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)
  5. docs/em/docs/advanced/response-cookies.md

    ## 📨 `Response` 🔗
    
    👆 💪 ✍ 🍪 🕐❔ 🛬 `Response` 🔗 👆 📟.
    
    👈, 👆 💪 ✍ 📨 🔬 [📨 📨 🔗](response-directly.md){.internal-link target=_blank}.
    
    ⤴️ ⚒ 🍪 ⚫️, &amp; ⤴️ 📨 ⚫️:
    
    ```Python hl_lines="10-12"
    {!../../../docs_src/response_cookies/tutorial001.py!}
    ```
    
    !!! tip
        ✔️ 🤯 👈 🚥 👆 📨 📨 🔗 ↩️ ⚙️ `Response` 🔢, FastAPI 🔜 📨 ⚫️ 🔗.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 1.8K bytes
    - Viewed (0)
  6. docs/zh/docs/tutorial/response-model.md

    ### `response_model_include` 和 `response_model_exclude`
    
    你还可以使用*路径操作装饰器*的 `response_model_include` 和 `response_model_exclude` 参数。
    
    它们接收一个由属性名称 `str` 组成的 `set` 来包含(忽略其他的)或者排除(包含其他的)这些属性。
    
    如果你只有一个 Pydantic 模型,并且想要从输出中移除一些数据,则可以使用这种快捷方法。
    
    !!! tip
        但是依然建议你使用上面提到的主意,使用多个类而不是这些参数。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 7.9K bytes
    - Viewed (0)
  7. docs/es/docs/advanced/response-directly.md

    Esto puede ser útil, por ejemplo, para devolver cookies o headers personalizados.
    
    ## Devolver una `Response`
    
    De hecho, puedes devolver cualquier `Response` o cualquier subclase de la misma.
    
    !!! tip "Consejo"
        `JSONResponse` en sí misma es una subclase de `Response`.
    
    Y cuando devuelves una `Response`, **FastAPI** la pasará directamente.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Jan 13 11:57:27 GMT 2024
    - 3.2K bytes
    - Viewed (0)
  8. docs/zh/docs/advanced/response-directly.md

    直接返回响应可能会有用处,比如返回自定义的响应头和 cookies。
    
    ## 返回 `Response`
    
    事实上,你可以返回任意 `Response` 或者任意 `Response` 的子类。
    
    !!! tip "小贴士"
        `JSONResponse` 本身是一个 `Response` 的子类。
    
    当你返回一个 `Response` 时,**FastAPI** 会直接传递它。
    
    **FastAPI** 不会用 Pydantic 模型做任何数据转换,不会将响应内容转换成任何类型,等等。
    
    这种特性给你极大的可扩展性。你可以返回任何数据类型,重写任何数据声明或者校验,等等。
    
    ## 在 `Response` 中使用 `jsonable_encoder`
    
    由于 **FastAPI** 并未对你返回的 `Response` 做任何改变,你必须确保你已经准备好响应内容。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 12 00:06:16 GMT 2022
    - 3.1K bytes
    - Viewed (0)
  9. docs/ja/docs/tutorial/response-model.md

    ```Python hl_lines="9 11 16"
    {!../../../docs_src/response_model/tutorial003.py!}
    ```
    
    ここでは、*path operation関数*がパスワードを含む同じ入力ユーザーを返しているにもかかわらず:
    
    ```Python hl_lines="24"
    {!../../../docs_src/response_model/tutorial003.py!}
    ```
    
    ...`response_model`を`UserOut`と宣言したことで、パスワードが含まれていません:
    
    ```Python hl_lines="22"
    {!../../../docs_src/response_model/tutorial003.py!}
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  10. tests/test_validate_response.py

    
    def test_valid_none_data():
        response = client.get("/items/validnone")
        data = response.json()
        assert response.status_code == 200
        assert data == {"name": "invalid", "price": 3.2, "owner_ids": None}
    
    
    def test_valid_none_none():
        response = client.get("/items/validnone", params={"send_none": "true"})
        data = response.json()
        assert response.status_code == 200
        assert data is None
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 2K bytes
    - Viewed (0)
Back to top