Skip to content

FlareRequest

class FlareRequest

Pure inbound representation of an HTTP request.

Carries only what arrived on the wire: method, URL, headers, raw body access, and adapter-derived primitives like the abort signal. Pipeline-scoped state (request state, parsed contract data, response serializers, outbound cookies) lives on FlareHttpContext, which wraps a FlareRequest and is what controllers, middleware, and handler functions actually receive.

Handed to you by the framework; see Requests.

method: string
nativeRequest: unknown
requestId: string
startTime: number
url: string
get headers(): Headers

returns Headers

get path(): string

returns string

get rawBody(): ArrayBuffer | null

returns ArrayBuffer | null

get rawQueryParams(): URLSearchParams

returns URLSearchParams

get rawRouteParams(): Record<string, string>

returns Record<string, string>

get signal(): AbortSignal

returns AbortSignal

buffer(maxBytes?: number): Promise<ArrayBuffer | null>

maxBytes? number

returns Promise<ArrayBuffer | null>

json(): Promise<JsonValue>

returns Promise<JsonValue>

stream(): AsyncIterable<Uint8Array>

Iterates the native inbound body without buffering through buffer.

returns AsyncIterable<Uint8Array>

Throws:

When buffer, text, or json has already started or finished reading the body. Pick one read strategy per request.

text(): Promise<string | null>

returns Promise<string | null>

Learn: Requests

Last updated: