Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for generator (0.17 sec)

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

    ```
    
    ### `StreamingResponse`
    
    Takes an async generator or a normal generator/iterator and streams the response body.
    
    ```Python hl_lines="2  14"
    {!../../../docs_src/custom_response/tutorial007.py!}
    ```
    
    #### Using `StreamingResponse` with file-like objects
    
    If you have a file-like object (e.g. the object returned by `open()`), you can create a generator function to iterate over that file-like object.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.7K bytes
    - Viewed (0)
  2. docs/de/docs/advanced/custom-response.md

    ```Python hl_lines="2  7  9"
    {!../../../docs_src/custom_response/tutorial006c.py!}
    ```
    
    ### `StreamingResponse`
    
    Nimmt einen asynchronen Generator oder einen normalen Generator/Iterator und streamt den Responsebody.
    
    ```Python hl_lines="2  14"
    {!../../../docs_src/custom_response/tutorial007.py!}
    ```
    
    #### Verwendung von `StreamingResponse` mit dateiähnlichen Objekten
    
    Plain Text
    - Registered: Sun May 05 07:19:11 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

    #### `HTMLResponse` を直接返す
    
    例えば、このようになります:
    
    ```Python hl_lines="7  21  23"
    {!../../../docs_src/custom_response/tutorial004.py!}
    ```
    
    この例では、関数 `generate_html_response()` は、`str` のHTMLを返すのではなく `Response` を生成して返しています。
    
    `generate_html_response()` を呼び出した結果を返すことにより、**FastAPI** の振る舞いを上書きする `Response` が既に返されています。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Jul 19 19:14:58 GMT 2021
    - 10.7K bytes
    - Viewed (0)
Back to top