Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 21 - 30 of 1,051 for bytesB (0.04 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

  1. docs_src/stream_data/tutorial002_py310.py

    binary_image = base64.b64decode(image_base64)
    
    
    def read_image() -> BytesIO:
        return BytesIO(binary_image)
    
    
    app = FastAPI()
    
    
    class PNGStreamingResponse(StreamingResponse):
        media_type = "image/png"
    
    
    @app.get("/image/stream", response_class=PNGStreamingResponse)
    async def stream_image() -> AsyncIterable[bytes]:
        with read_image() as image_file:
            for chunk in image_file:
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Feb 27 20:51:40 GMT 2026
    - 5.6K bytes
    - Click Count (0)
  2. docs/es/docs/advanced/stream-data.md

    Esto también significa que con `StreamingResponse` tienes la libertad y la responsabilidad de producir y codificar los bytes de datos exactamente como necesites enviarlos, independientemente de las anotaciones de tipos. 🤓
    
    ### Transmitir bytes { #stream-bytes }
    
    Uno de los casos de uso principales sería transmitir `bytes` en lugar de strings; por supuesto puedes hacerlo.
    
    {* ../../docs_src/stream_data/tutorial001_py310.py ln[44:47] hl[47] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:12:26 GMT 2026
    - 5.7K bytes
    - Click Count (0)
  3. docs/tr/docs/advanced/stream-data.md

    ### Bytes Akışı { #stream-bytes }
    
    Başlıca kullanım senaryolarından biri string yerine `bytes` akıtmaktır; elbette bunu yapabilirsiniz.
    
    {* ../../docs_src/stream_data/tutorial001_py310.py ln[44:47] hl[47] *}
    
    ## Özel bir `PNGStreamingResponse` { #a-custom-pngstreamingresponse }
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:51:35 GMT 2026
    - 5.8K bytes
    - Click Count (0)
  4. docs/pt/docs/advanced/stream-data.md

    Isso também significa que, com `StreamingResponse`, você tem a liberdade e a responsabilidade de produzir e codificar os bytes exatamente como precisam ser enviados, independentemente das anotações de tipo. 🤓
    
    ### Transmitir bytes { #stream-bytes }
    
    Um dos principais casos de uso é transmitir `bytes` em vez de strings; você pode fazer isso sem problemas.
    
    {* ../../docs_src/stream_data/tutorial001_py310.py ln[44:47] hl[47] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:20:13 GMT 2026
    - 5.7K bytes
    - Click Count (0)
  5. docs/de/docs/advanced/stream-data.md

    ### Bytes streamen { #stream-bytes }
    
    Einer der Hauptanwendungsfälle wäre, `bytes` statt Strings zu streamen, das können Sie selbstverständlich tun.
    
    {* ../../docs_src/stream_data/tutorial001_py310.py ln[44:47] hl[47] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 17:48:21 GMT 2026
    - 6K bytes
    - Click Count (0)
  6. docs/en/docs/advanced/stream-data.md

    This also means that with `StreamingResponse` you have the **freedom** and **responsibility** to produce and encode the data bytes exactly as you need them to be sent, independent of the type annotations. 🤓
    
    ### Stream Bytes { #stream-bytes }
    
    One of the main use cases would be to stream `bytes` instead of strings, you can of course do it.
    
    {* ../../docs_src/stream_data/tutorial001_py310.py ln[44:47] hl[47] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 5.4K bytes
    - Click Count (0)
  7. docs/ru/docs/advanced/stream-data.md

    ### Потоковая передача байтов { #stream-bytes }
    
    Один из основных сценариев — стримить `bytes` вместо строк, и, конечно, это можно сделать.
    
    {* ../../docs_src/stream_data/tutorial001_py310.py ln[44:47] hl[47] *}
    
    ## Пользовательский `PNGStreamingResponse` { #a-custom-pngstreamingresponse }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 17:56:20 GMT 2026
    - 8.9K bytes
    - Click Count (0)
  8. docs/zh-hant/docs/advanced/stream-data.md

    {* ../../docs_src/stream_data/tutorial001_py310.py ln[32:35] hl[33] *}
    
    這也意味著使用 `StreamingResponse` 時,你擁有自由與責任,需依需求自行產生並編碼要傳送的位元組資料,與型別註解無關。 🤓
    
    ### 串流位元組 { #stream-bytes }
    
    一個主要用例是串流 `bytes` 而非字串,當然可以這麼做。
    
    {* ../../docs_src/stream_data/tutorial001_py310.py ln[44:47] hl[47] *}
    
    ## 自訂 `PNGStreamingResponse` { #a-custom-pngstreamingresponse }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:33:04 GMT 2026
    - 4.9K bytes
    - Click Count (0)
  9. docs/fr/docs/advanced/stream-data.md

    ### Diffuser des bytes { #stream-bytes }
    
    L'un des principaux cas d'usage consiste à diffuser des `bytes` au lieu de chaînes ; vous pouvez bien sûr le faire.
    
    {* ../../docs_src/stream_data/tutorial001_py310.py ln[44:47] hl[47] *}
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:33:45 GMT 2026
    - 6.2K bytes
    - Click Count (0)
  10. docs/zh/docs/advanced/stream-data.md

    ### 模拟文件 { #simulate-a-file }
    
    在这个示例中,我们用 `io.BytesIO` 模拟了一个文件,它是只驻留在内存中的类文件对象,但提供相同的接口。
    
    例如,我们可以像对文件那样迭代它来消费其内容。
    
    {* ../../docs_src/stream_data/tutorial002_py310.py ln[1:27] hl[3,12:13,25] *}
    
    /// note | 技术细节
    
    另外两个变量 `image_base64` 和 `binary_image` 表示一张图像,先用 Base64 编码,再转换为 bytes,最后传给 `io.BytesIO`。
    
    只是为了让它们能和示例放在同一个文件里,便于你直接复制运行。🥚
    
    ///
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:29:48 GMT 2026
    - 5.2K bytes
    - Click Count (0)
Back to Top