Skip to content

ResponseBodyBuilder

[Source]

Body construction phase of ResponseBuilder.

Add body data with add_chunk(), then call build() to produce the final serialized response bytes.

interface ref ResponseBodyBuilder

Public Functions

add_chunk

[Source]

Append body data to the response.

Multiple chunks are concatenated in order. For responses with no body, call build() directly without calling add_chunk().

fun ref add_chunk(
  data: (String val | Array[U8 val] val))
: ResponseBodyBuilder ref

Parameters

Returns


build

[Source]

Produce the complete serialized HTTP response as an immutable byte array.

The result is suitable for caching and reuse across multiple requests via Responder.respond().

Consumes the internal buffer — a second call returns an empty array.

fun ref build()
: Array[U8 val] val

Returns