Skip to content

FlareResponse

class FlareResponse

Outbound response value returned by Flare handlers and helper methods.

Discriminated on body type so the constructor selects the right Content-Type and Content-Length up front. JSON bodies keep their object form on jsonBody until the per-status serializer runs, at which point [FINALIZE_JSON_BODY] writes the serialized payload to body and updates Content-Length.

new FlareResponse(status)

4 overloads

new FlareResponse(status: number): FlareResponse

status number

new FlareResponse(status: number, body: JsonValue, init?: ResponseInit): FlareResponse

status number

body JsonValue

init? ResponseInit

new FlareResponse(status: number, body: Uint8Array, init?: ResponseInit): FlareResponse

status number

body Uint8Array

init? ResponseInit

new FlareResponse(status: number, body: AsyncIterable<Uint8Array>, init?: ResponseInit): FlareResponse

status number

body AsyncIterable<Uint8Array>

init? ResponseInit

bodyStream: AsyncIterable<Uint8Array> | null
headers: ResponseHeaders
status: number
get body(): string | Uint8Array | null

returns string | Uint8Array | null

get jsonBody(): JsonValue

returns JsonValue

Learn: Overview

Last updated: