Documentation
Interfaces
handler.Request

Interface: Request<Raw, Context>

handler.Request

Server agnostic request interface containing the raw request which is server dependant.

Type parameters

NameType
Rawunknown
Contextunknown

Properties

body

Readonly body: null | string | Record<PropertyKey, unknown> | () => null | string | Record<PropertyKey, unknown> | Promise<null | string | Record<PropertyKey, unknown>>

Parsed request body or a parser function.

If the provided function throws, the error message “Unparsable JSON body” will be in the erroneous response.

Defined in

src/handler.ts:55


context

context: Context

Context value about the incoming request, you’re free to pass any information here.

Intentionally not readonly because you’re free to mutate it whenever you want.

Defined in

src/handler.ts:73


headers

Readonly headers: RequestHeaders

Defined in

src/handler.ts:48


method

Readonly method: string

Defined in

src/handler.ts:46


raw

Readonly raw: Raw

The raw request itself from the implementing server.

Defined in

src/handler.ts:67


url

Readonly url: string

Defined in

src/handler.ts:47