The body of the HTTP response. Can be of any type, including strings, objects, or buffers.
OptionalcharsetThe character set used for encoding the response body. Defaults to utf-8 if not specified.
Headers to include in the HTTP response.
Can be provided as a Map<string, string> or Headers object.
The HTTP status code of the response (e.g., 200, 404).
The status message accompanying the HTTP status code (e.g., OK, Not Found).
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.
A function to stream a file as the HTTP response. Can be synchronous or asynchronous.
Represents options for configuring a raw HTTP response.
Extends the
RawResponseOptionsinterface to include additional properties for managing response content, headers, status codes, and streaming files.