Scoop API

scoop:scoop.http.server:0.1.0

HttpStreamBody

class HttpStreamBody

source · line 21
public
public class HttpStreamBody public constructor(
    /** The producer, invoked only when the request and status permit content. */
    public val produce: suspend (HttpBodyWriter) -> Unit,
    /** The exact original-content length, if known without executing the producer. */
    public val length: Long? = None,
    /** Trailers collected after successful production; never called for HEAD. */
    public val trailers: (() -> List<HttpField>)? = None
)

A suspending producer and its optional original-content length and final trailers.

property length

source · line 25
public
public val length: Long? = None

get: public read-only

The exact original-content length, if known without executing the producer.

property produce

source · line 23
public
public val produce: suspend (HttpBodyWriter) -> Unit

get: public read-only

The producer, invoked only when the request and status permit content.

property trailers

source · line 27
public
public val trailers: (() -> List<HttpField>)? = None

get: public read-only

Trailers collected after successful production; never called for HEAD.