Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 1 of 1 for stream_image (0.05 seconds)

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

  1. docs_src/stream_data/tutorial002_py310.py

    
    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:
                yield chunk
    
    
    @app.get("/image/stream-no-async", response_class=PNGStreamingResponse)
    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)
Back to Top