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;
        url: string;
        arrayBuffer?(): Promise<ArrayBuffer>;
        blob?(): Promise<Blob>;
        clone?(): HttpRequestLike;
        formData?(): Promise<FormData>;
        json(): Promise<unknown>;
        text(): Promise<string>;
    }
    Index

    Properties

    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.

    url: string

    Absolute request URL.

    Methods

    • 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>