Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for Content (0.18 sec)

  1. docs/zh/docs/advanced/custom-response.md

    ### `Response`
    
    其他全部的响应都继承自主类 `Response`。
    
    你可以直接返回它。
    
    `Response` 类接受如下参数:
    
    * `content` - 一个 `str` 或者 `bytes`。
    * `status_code` - 一个 `int` 类型的 HTTP 状态码。
    * `headers` - 一个由字符串组成的 `dict`。
    * `media_type` - 一个给出媒体类型的 `str`,比如 `"text/html"`。
    
    FastAPI(实际上是 Starlette)将自动包含 Content-Length 的头。它还将包含一个基于 media_type 的 Content-Type 头,并为文本类型附加一个字符集。
    
    
    ```Python hl_lines="1  18"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 12 00:06:16 GMT 2022
    - 7.8K bytes
    - Viewed (1)
  2. docs/em/docs/advanced/custom-response.md

    ```Python hl_lines="2  7  19"
    {!../../../docs_src/custom_response/tutorial003.py!}
    ```
    
    !!! warning
         `Response` 📨 🔗 👆 *➡ 🛠️ 🔢* 🏆 🚫 📄 🗄 (🖼, `Content-Type` 🏆 🚫 📄) & 🏆 🚫 ⭐ 🏧 🎓 🩺.
    
    !!! info
        ↗️, ☑ `Content-Type` 🎚, 👔 📟, ♒️, 🔜 👟 ⚪️➡️ `Response` 🎚 👆 📨.
    
    ### 📄 🗄 & 🔐 `Response`
    
    🚥 👆 💚 🔐 📨 ⚪️➡️ 🔘 🔢 ✋️ 🎏 🕰 📄 "📻 🆎" 🗄, 👆 💪 ⚙️ `response_class` 🔢 & 📨 `Response` 🎚.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 9.8K bytes
    - Viewed (0)
Back to top