Returns the HTTP method of the request (e.g. GET, POST).
The request body as a ReadableStream, or null if the body has
already is not available (e.g. GET/HEAD requests).
Allows streaming the body in chunks via the Streams API.
An AbortSignal that is aborted when the underlying request is cancelled or times out.
Handlers can listen to this signal to stop long-running work early when the client disconnects or the request reaches its deadline.
Returns the full request URL as a string.
The underlying standard Web API Request object.
Useful for interoperability with third-party libraries that expect
a native Request, such as better-auth.
Returns the raw unparsed FormData as a plain object, or an empty object if not present.
Each field is either a string value or an IHttpFile instance for file uploads.
StaticfromCreates an HttpReq instance from a standard Web API Request object.
A new IHttpReq instance wrapping the request.
StatictestCreates an HttpReq instance with synthetic data for testing.
Unlike HttpReq.fromWebReq, this method does not require a
real Web API Request object. Instead, you provide mock values for
path parameters, search parameters, headers, cookies, and body
through TestReqSettings. The resulting HttpReq behaves
identically to one created from a real request, including validation
support.
Configuration for the test request, including mock data and optional validation schemas.
A new IHttpReq instance suitable for testing.
The default implementation of IHttpReq.
Provides typed access to all request data sources — JSON body, form fields, path parameters, query parameters, headers, and the raw body.
Use HttpReq.fromWebReq to create an instance from a standard Web API
Requestobject.Type Param: TReqMethod
The HTTP method type.
Type Param: TReqJson
The type of the parsed JSON body.
Type Param: TReqFields
The type of the parsed form fields.
Type Param: TReqParams
The type of the parsed path parameters.
Type Param: TReqSearchParams
The type of the parsed query parameters.
Type Param: TReqHeaders
The type of the parsed headers.
Type Param: TReqFiles
The expected file upload definitions.
Type Param: TCookieData
A record mapping cookie names to their value types.
IMPORT_PATH:
"@daiso-tech/core/http-router"