Skip to content

basalt / fastify/src / HttpRequest

Interface: HttpRequest ​

Defined in: http/src/route.ts:11

Framework-neutral request seen by handlers, enrichers and guards. Adapters (Fastify/Express/Hono) build this from their native request; raw is the escape hatch to that native object.

Properties ​

body ​

> body: unknown

Defined in: http/src/route.ts:19


bodyBytes? ​

> optional bodyBytes?: Uint8Array<ArrayBufferLike>

Defined in: http/src/route.ts:39

The untouched request bytes, when the adapter could NOT leave the body unread and kept them instead — an app-wide express.json() is the case this exists for, since its verify hook is the only place the original bytes still are. Set only for rawBody() routes, and only when bodyStream cannot be offered; the pipeline prefers it over reading a stream that is already spent. Absent everywhere else.


bodyStream? ​

> optional bodyStream?: Readable | ReadableStream<Uint8Array<ArrayBufferLike>>

Defined in: http/src/route.ts:30

The unread request body as a stream — a Node Readable or a web ReadableStream. Adapters set it only for upload() and rawBody() routes, whose body they deliberately leave unparsed; the pipeline streams it through the multipart parser, or reads it to a capped buffer. Absent everywhere else.


headers ​

> headers: Record<string, string | string[] | undefined>

Defined in: http/src/route.ts:16

Header names are lower-cased by every adapter.


ip? ​

> optional ip?: string

Defined in: http/src/route.ts:20


method ​

> method: string

Defined in: http/src/route.ts:12


params ​

> params: Record<string, string>

Defined in: http/src/route.ts:17


query ​

> query: unknown

Defined in: http/src/route.ts:18


raw ​

> raw: unknown

Defined in: http/src/route.ts:40


routePattern? ​

> optional routePattern?: string

Defined in: http/src/route.ts:22

Matched route template (e.g. /users/:id), when the adapter knows it.


url ​

> url: string

Defined in: http/src/route.ts:14

Full URL path (+ query string).

Released under the MIT License.