ReadonlyheadersRequest headers (web-standard Headers).
Optional ReadonlyipSocket peer on Node, Deno and Bun; absent on Workers and plain fetch calls.
Behind a proxy this is the proxy. Read CLIENT_IP_STATE_KEY for the resolved client.
OptionallocaleThe resolved locale — a BCP 47 tag from the application's supported set — populated by the localization plugin's middleware (priority 45). Absent when no localization plugin is registered, or on a path its middleware excludes.
Like tenant, it accepts one implicit write per request; use
replaceLocale for an intentional replacement, such as
applying a signed-in user's saved preference once authentication (300)
has run. Three things to keep in mind: a reader running at a LOWER
middleware priority than 45 sees undefined (the priority table orders
them, exactly as for tenant at 40); a response cache keys on the value
present when the cache runs, so an override must precede the cache
lookup to be reflected in it; and this is a preference, never an
authorization input — any client can choose any supported locale.
ReadonlymethodThe HTTP method.
ReadonlypathThe URL path component (no query string).
Optional ReadonlyrawThe undisturbed web-standard Request, preserved for WebSocket upgrade
and gRPC dispatch after the middleware pipeline.
Populated by the HTTP adapter before the body is consumed by the framework mapping. Optional because injected or test requests may not carry one.
OptionalsignalAn abort signal that fires when the underlying HTTP connection is
severed (client disconnect, timeout). Populated by the HTTP adapter
from the native Request.signal; optional because injected / test
requests may not carry one.
When absent, the kernel's request-context factory falls back to a
non-aborting sentinel so that producers reading
IRequestContext.signal always have a live signal to listen on.
OptionaltenantThe resolved tenant, populated by the multi-tenancy middleware. Absent when no tenant could be resolved or multi-tenancy is not enabled.
It accepts one implicit write per request; use replaceTenant
for an intentional replacement. Like user, this detects late accidental
overwrites and is not an authorization control.
ReadonlyurlThe full request URL.
OptionaluserThe authenticated principal, populated by authentication middleware. Absent when the request is unauthenticated.
It accepts one implicit write per request; a second assignment throws so
independent identity writers fail loudly. Use replacePrincipal
for an intentional replacement such as step-up authentication. This is
not an authorization control: a write before authentication is still the
first write and is allowed.
Reads the body as raw bytes.
The body bytes
OptionalformReads the body as a form, for both application/x-www-form-urlencoded
and multipart/form-data requests.
The parse is the shared parseFormBody, memoized exactly as json() is —
the in-flight promise is cached (a rejection with it), so two middleware
reading the same body trigger one parse, not two.
Optional on the signal? / fs? / raw? precedent: a custom IRequest
implementor may omit it. Such a caller falls back to
parseFormBody(await request.bytes(), request.headers.get('content-type')),
the same common function the producers call — what the accessor adds
over the fallback is the memoization.
The parsed form. A multipart body the parser cannot make sense of yields an EMPTY form rather than a rejection: the promoted parser's released behaviour, kept so the accessor changes where parsing happens, never what a parse yields.
Reads and parses the body as JSON.
The expected body shape (validate before trusting)
The parsed body
Reads the body as text.
The body text
Runtime-agnostic view of an incoming HTTP request.
Since
0.1.0