Beignet API reference
    Preparing search index...

    Interface HttpRequestLike

    Framework-neutral request shape consumed by Beignet server adapters.

    Platform adapters should convert their native request into this shape before passing it to server.api(...) or a single route handler.

    interface HttpRequestLike {
        headers: Headers;
        method: string;
        raw?: Request;
        signal?: AbortSignal;
        url: string;
        arrayBuffer?(): Promise<ArrayBuffer>;
        blob?(): Promise<Blob>;
        clone?(): HttpRequestLike;
        formData?(): Promise<FormData>;
        json(): Promise<unknown>;
        text(): Promise<string>;
    }
    Index
    headers: Headers

    Request headers.

    method: string

    HTTP method as received from the platform.

    raw?: Request

    The platform request when an adapter has one available.

    Use this as an escape hatch for platform-specific APIs. Prefer the framework-agnostic methods below when possible.

    signal?: AbortSignal

    Abort signal for the request lifecycle when the platform exposes one.

    Streaming handlers should pass this to resources that must close when the client disconnects. Adapters without cancellation support may omit it.

    url: string

    Absolute request URL.

    • Parse the request body as an array buffer when the platform supports it.

      Returns Promise<ArrayBuffer>

    • Parse the request body as a Blob when the platform supports it.

      Returns Promise<Blob>

    • Clone the request when the platform supports replaying the body.

      Returns HttpRequestLike

    • Parse the request body as form data when the platform supports it.

      Returns Promise<FormData>

    • Parse the request body as JSON.

      Returns Promise<unknown>

    • Parse the request body as text.

      Returns Promise<string>