Http module

stream_response

procedure · 1 overloadsince 0.30.0Source

A response whose body produce writes with send_chunk. data is handed to it as is.

stream_response :: (
    produce: Stream_Producer,
    data: *void,
    content_type: string,
    status := 200
) -> Response

A response whose body produce writes with send_chunk. data is handed to it as is.

Parameters

produce: Stream_Producer
writes the body; it runs after the head has been sent.
data: *void
handed to produce untouched. It has to outlive the response.
content_type: string
the Content-Type header value.
status := 200
the HTTP status code.

Returns

See also