Stone.js API
    Preparing search index...

    Represents options for configuring a raw HTTP response.

    Extends the RawResponseOptions interface to include additional properties for managing response content, headers, status codes, and streaming files.

    interface RawHttpResponseOptions {
        body: unknown;
        charset?: string;
        headers: Headers | Map<string, string>;
        statusCode: number;
        statusMessage: string;
        stream: ReadableStream<Uint8Array<ArrayBufferLike>> | ReadableStream;
        streamFile: () => void | Promise<void>;
        [k: string | number | symbol]: unknown;
    }

    Hierarchy

    • RawResponseOptions
      • RawHttpResponseOptions

    Indexable

    • [k: string | number | symbol]: unknown
    Index
    body: unknown

    The body of the HTTP response. Can be of any type, including strings, objects, or buffers.

    charset?: string

    The character set used for encoding the response body. Defaults to utf-8 if not specified.

    headers: Headers | Map<string, string>

    Headers to include in the HTTP response. Can be provided as a Map<string, string> or Headers object.

    statusCode: number

    The HTTP status code of the response (e.g., 200, 404).

    statusMessage: string

    The status message accompanying the HTTP status code (e.g., OK, Not Found).

    stream: ReadableStream<Uint8Array<ArrayBufferLike>> | ReadableStream

    A readable stream to pipe as the HTTP response body (streaming SSR, SSE, chunked APIs). Accepts a Web ReadableStream (runtime-agnostic, e.g. from React renderToReadableStream) or a Node Readable. When set, it takes precedence over body.

    streamFile: () => void | Promise<void>

    A function to stream a file as the HTTP response. Can be synchronous or asynchronous.