jmap-kit
    Preparing search index...

    Type Alias Transport

    An implementation providing HTTP request functionality for GET and POST requests.

    Implementations are expected to handle authentication and authorisation internally. For example, automatically including Authorization headers in the requests with a valid Bearer token.

    The responseType parameter specifies the expected response type:

    • "json" (default): parses and returns JSON.
    • "blob": returns a Blob (for binary data).
    type Transport = {
        get: <T>(
            url: string | URL,
            options?: Omit<TransportRequestOptions, "body">,
        ) => Promise<T>;
        post: <T>(
            url: string | URL,
            options?: TransportRequestOptions,
        ) => Promise<T>;
    }
    Index

    Properties

    Properties

    get: <T>(
        url: string | URL,
        options?: Omit<TransportRequestOptions, "body">,
    ) => Promise<T>

    Perform an HTTP GET request to the specified URL with the included options.

    Type Declaration

      • <T>(
            url: string | URL,
            options?: Omit<TransportRequestOptions, "body">,
        ): Promise<T>
      • Type Parameters

        • T

        Parameters

        • url: string | URL

          The URL to request.

        • Optionaloptions: Omit<TransportRequestOptions, "body">

          Additional options for the request (headers, responseType, signal).

        Returns Promise<T>

        The parsed response body from a successful request.

    If parsing the response fails.

    For JMAP-specific protocol errors with non-200 status codes and JSON response bodies conforming to RFC 7807 Problem Details.

    For network errors, timeouts, and other request failures.

    post

    post: <T>(url: string | URL, options?: TransportRequestOptions) => Promise<T>

    Perform an HTTP POST request to the specified URL with the included options.

    Type Declaration

      • <T>(url: string | URL, options?: TransportRequestOptions): Promise<T>
      • Type Parameters

        • T

        Parameters

        • url: string | URL

          The URL to request.

        • Optionaloptions: TransportRequestOptions

          Additional options for the request (body, headers, responseType, signal).

        Returns Promise<T>

        The parsed response body from a successful request.

    If parsing the response fails.

    For JMAP-specific protocol errors with non-200 status codes and JSON response bodies conforming to RFC 7807 Problem Details.

    For network errors, timeouts, and other request failures.