IHttpReqBase: AsyncIterable<unknown> & {
    method: HttpMethod;
    readableStream: ReadableStream<unknown> | null;
    signal: AbortSignal;
    url: string;
    webReq: Request;
    arrayBuffer(): Promise<ArrayBuffer>;
    blob(): Promise<Blob>;
    bytes(): Promise<Uint8Array<ArrayBufferLike>>;
    rawCookies(): Partial<Record<string, string>>;
    rawFormData(): Promise<
        Partial<Record<string, string | string[] | IHttpFile | IHttpFile[]>>,
    >;
    rawHeaders(): Partial<Record<string, string>>;
    rawJson(): Promise<unknown>;
    rawParams(): Partial<Record<string, string>>;
    rawSearchParams(): Partial<Record<string, string | string[]>>;
    text(): Promise<string>;
}

The base request interface providing raw, unvalidated access to all request data sources.

Implements AsyncIterable<unknown> so the request can be streamed, and exposes raw methods for every source (cookies, JSON body, form data, path params, query params, headers) alongside the underlying Web API Request.

IMPORT_PATH: "@daiso-tech/core/http-router/contracts"

Type declaration

  • Readonlymethod: HttpMethod

    Returns the HTTP method of the request (e.g. GET, POST).

  • ReadonlyreadableStream: ReadableStream<unknown> | null

    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.

  • Readonlysignal: AbortSignal

    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.

  • Readonlyurl: string

    Returns the full request URL as a string.

  • ReadonlywebReq: Request

    The underlying standard Web API Request object.

    Useful for interoperability with third-party libraries that expect a native Request, such as better-auth.

  • arrayBuffer:function
  • blob:function
  • bytes:function
  • rawCookies:function
  • rawFormData:function
  • rawHeaders:function
  • rawJson:function
  • rawParams:function
  • rawSearchParams:function
  • text:function