class HTTP::BodyWriter

Given to a Stream body's procedure: each write is a chunk.

<std:http>:857

Class methods

def self.new(io: IO, chunked: Bool, timeout: Duration, head: Bool = …) -> HTTP::BodyWriter

A writer on io; the server makes it for a ResponseBody::Stream body.

<std:http>:866

Methods

def write(data: String) -> Void

Sends data as one chunk, within the server's write_timeout; empty data sends nothing.

<std:http>:870

def write(data: Bytes) -> Void

Sends data as one chunk, within the server's write_timeout; empty data sends nothing.

<std:http>:873

def flush -> Void

Flushes what has been written to the connection.

<std:http>:890

def finish -> Void

Ends a chunked body (the last, empty chunk). The server calls it when the ResponseBody::Stream procedure returns.

<std:http>:897