Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 11 - 20 of 43 for FileResponse (0.32 seconds)

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

    If you are streaming JSON Lines, follow the [Stream JSON Lines](../tutorial/stream-json-lines.md) tutorial.
    
    ///
    
    ### `FileResponse` { #fileresponse }
    
    Asynchronously streams a file as the response.
    
    Takes a different set of arguments to instantiate than the other response types:
    
    * `path` - The file path to the file to stream.
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 11K bytes
    - Click Count (0)
  2. docs/zh-hant/docs/advanced/custom-response.md

    ///
    
    /// tip
    
    與其直接回傳 `StreamingResponse`,你大概會想遵循[資料串流](./stream-data.md)中的作法,這樣更方便,並且會在底層幫你處理取消。
    
    如果你要串流 JSON Lines,請參考教學:[串流 JSON Lines](../tutorial/stream-json-lines.md)。
    
    ///
    
    ### `FileResponse` { #fileresponse }
    
    以非同步串流方式將檔案作為回應。
    
    它在初始化時所需的參數與其他回應型別不同:
    
    - `path` - 要串流的檔案路徑。
    - `headers` - 要包含的自訂標頭,字典形式。
    - `media_type` - 描述 media type 的字串。若未設定,將根據檔名或路徑推斷 media type。
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 10.3K bytes
    - Click Count (0)
  3. docs/en/docs/advanced/additional-responses.md

    {* ../../docs_src/additional_responses/tutorial002_py310.py hl[17:22,26] *}
    
    /// note
    
    Notice that you have to return the image using a `FileResponse` directly.
    
    ///
    
    /// info
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 8.8K bytes
    - Click Count (0)
  4. docs/zh/docs/advanced/additional-responses.md

    例如,你可以添加一个额外的媒体类型 `image/png`,声明你的*路径操作*可以返回 JSON 对象(媒体类型为 `application/json`)或 PNG 图片:
    
    {* ../../docs_src/additional_responses/tutorial002_py310.py hl[17:22,26] *}
    
    /// note | 注意
    
    请注意,你必须直接使用 `FileResponse` 返回图片。
    
    ///
    
    /// info | 信息
    
    除非你在 `responses` 参数中明确指定不同的媒体类型,否则 FastAPI 会假设响应与主响应类具有相同的媒体类型(默认是 `application/json`)。
    
    但是如果你指定了一个媒体类型为 `None` 的自定义响应类,FastAPI 会对任何具有关联模型的附加响应使用 `application/json`。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 8.7K bytes
    - Click Count (0)
  5. docs/ja/docs/advanced/additional-responses.md

    例えば、`image/png` の追加メディアタイプを加え、あなたの *path operation* が JSON オブジェクト(メディアタイプ `application/json`)または PNG 画像を返せることを宣言できます:
    
    {* ../../docs_src/additional_responses/tutorial002_py310.py hl[17:22,26] *}
    
    /// note | 備考
    
    画像は `FileResponse` を使って直接返す必要がある点に注意してください。
    
    ///
    
    /// info | 情報
    
    `responses` パラメータで明示的に別のメディアタイプを指定しない限り、FastAPI はレスポンスがメインのレスポンスクラスと同じメディアタイプ(デフォルトは `application/json`)であるとみなします。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 10K bytes
    - Click Count (0)
  6. docs/uk/docs/advanced/json-base64-bytes.md

    ## Base64 проти файлів { #base64-vs-files }
    
    Насамперед розгляньте, чи можете ви використати [Файли запиту](../tutorial/request-files.md) для завантаження двійкових даних і [Користувацька відповідь - FileResponse](./custom-response.md#fileresponse--fileresponse-) для надсилання двійкових даних замість кодування їх у JSON.
    
    JSON може містити лише строки, закодовані в UTF-8, тому він не може містити «сирі» байти.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:25:54 GMT 2026
    - 3.7K bytes
    - Click Count (0)
  7. docs/pt/docs/advanced/json-base64-bytes.md

    ## Base64 vs Arquivos { #base64-vs-files }
    
    Primeiro, considere se você pode usar [Arquivos na request](../tutorial/request-files.md) para fazer upload de dados binários e [Response personalizada - FileResponse](./custom-response.md#fileresponse--fileresponse-) para enviar dados binários, em vez de codificá-los em JSON.
    
    JSON só pode conter strings codificadas em UTF-8, portanto não pode conter bytes puros.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:20:13 GMT 2026
    - 2.6K bytes
    - Click Count (0)
  8. docs/tr/docs/advanced/json-base64-bytes.md

    ## Base64 ve Dosyalar { #base64-vs-files }
    
    İkili veriyi JSON içinde encode etmek yerine, yükleme için [Request Files](../tutorial/request-files.md) ve gönderim için [Custom Response - FileResponse](./custom-response.md#fileresponse--fileresponse-) kullanıp kullanamayacağınıza önce bir bakın.
    
    JSON sadece UTF-8 ile encode edilmiş string'ler içerebilir, dolayısıyla ham bytes içeremez.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:51:35 GMT 2026
    - 2.6K bytes
    - Click Count (0)
  9. docs/de/docs/advanced/json-base64-bytes.md

    ## Base64 vs Dateien { #base64-vs-files }
    
    Prüfen Sie zunächst, ob Sie [Request Files](../tutorial/request-files.md) zum Hochladen von Binärdaten und [Benutzerdefinierte Response – FileResponse](./custom-response.md#fileresponse--fileresponse-) zum Senden von Binärdaten verwenden können, anstatt sie in JSON zu kodieren.
    
    JSON kann nur UTF-8-kodierte Strings enthalten, es kann daher keine rohen Bytes enthalten.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 17:48:21 GMT 2026
    - 2.8K bytes
    - Click Count (0)
  10. docs/es/docs/advanced/json-base64-bytes.md

    ## Base64 vs Archivos { #base64-vs-files }
    
    Considera primero si puedes usar [Archivos en request](../tutorial/request-files.md) para subir datos binarios y [Response personalizada - FileResponse](./custom-response.md#fileresponse--fileresponse-) para enviar datos binarios, en lugar de codificarlos en JSON.
    
    JSON solo puede contener strings codificados en UTF-8, así que no puede contener bytes crudos.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:12:26 GMT 2026
    - 2.6K bytes
    - Click Count (0)
Back to Top