Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for lengthOf (0.16 sec)

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

    `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"
    {!../../../docs_src/response_directly/tutorial002.py!}
    ```
    
    ### `HTMLResponse`
    
    如上文所述,接受文本或字节并返回 HTML 响应。
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu May 12 00:06:16 GMT 2022
    - 7.8K bytes
    - Viewed (1)
  2. docs/de/docs/advanced/custom-response.md

    * `status_code` – Ein `int`-HTTP-Statuscode.
    * `headers` – Ein `dict` von Strings.
    * `media_type` – Ein `str`, der den Medientyp angibt. Z. B. `"text/html"`.
    
    FastAPI (eigentlich Starlette) fügt automatisch einen Content-Length-Header ein. Außerdem wird es einen Content-Type-Header einfügen, der auf dem media_type basiert, und für Texttypen einen Zeichensatz (charset) anfügen.
    
    ```Python hl_lines="1  18"
    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)
  3. docs/ja/docs/advanced/custom-response.md

    以下のパラメータを受け付けます。
    
    * `content` - `str` か `bytes`。
    * `status_code` - `int` のHTTPステータスコード。
    * `headers` - 文字列の `dict` 。
    * `media_type` - メディアタイプを示す `str` 。例えば `"text/html"` 。
    
    FastAPI (実際にはStarlette) は自動的にContent-Lengthヘッダーを含みます。また、media_typeに基づいたContent-Typeヘッダーを含み、テキストタイプのためにcharsetを追加します。
    
    ```Python hl_lines="1  18"
    {!../../../docs_src/response_directly/tutorial002.py!}
    ```
    
    ### `HTMLResponse`
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Jul 19 19:14:58 GMT 2021
    - 10.7K bytes
    - Viewed (0)
  4. docs/en/docs/advanced/custom-response.md

    * `status_code` - An `int` HTTP status code.
    * `headers` - A `dict` of strings.
    * `media_type` - A `str` giving the media type. E.g. `"text/html"`.
    
    FastAPI (actually Starlette) will automatically include a Content-Length header. It will also include a Content-Type header, based on the media_type and appending a charset for text types.
    
    ```Python hl_lines="1  18"
    {!../../../docs_src/response_directly/tutorial002.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)
  5. docs/em/docs/advanced/custom-response.md

    * `path` - 📁 📁 🎏.
    * `headers` - 🙆 🛃 🎚 🔌, 📖.
    * `media_type` - 🎻 🤝 📻 🆎. 🚥 🔢, 📁 ⚖️ ➡ 🔜 ⚙️ 🔑 📻 🆎.
    * `filename` - 🚥 ⚒, 👉 🔜 🔌 📨 `Content-Disposition`.
    
    📁 📨 🔜 🔌 ☑ `Content-Length`, `Last-Modified` & `ETag` 🎚.
    
    ```Python hl_lines="2  10"
    {!../../../docs_src/custom_response/tutorial009.py!}
    ```
    
    👆 💪 ⚙️ `response_class` 🔢:
    
    ```Python hl_lines="2  8  10"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 9.8K bytes
    - Viewed (0)
Back to top