octez.js TypeDocs
    Preparing search index...

    HTTP client used by octez.js to communicate with Tezos RPC nodes.

    Uses globalThis.fetch (Node.js >= 22 built-in or browser native). Retries retriable transport errors (socket resets, DNS, timeouts) and transient server responses (429/502/503/504) on idempotent/retriable requests, honoring a Retry-After header when the server sends one, else falling back to exponential backoff with jitter. Configure via environment variables:

    • OCTEZJS_HTTP_RETRY_COUNT - max retries (default 1)
    • OCTEZJS_HTTP_RETRY_BASE_MS - base delay in ms (default 100)
    • OCTEZJS_HTTP_TRACE - emit JSON request logs when true or 1
    • TAQUITO_HTTP_RETRY_COUNT / TAQUITO_HTTP_RETRY_BASE_MS / TAQUITO_HTTP_TRACE - deprecated aliases for the above, still honored when the OCTEZJS_* name is unset
    Index
    • Send an HTTP request to the given URL, with automatic retries on transport errors.

      Type Parameters

      • T

      Parameters

      • options: HttpRequestOptions

        Request configuration (URL, method, timeout, headers, etc.).

      • Optionaldata: string | object

        Request body, serialized to JSON via JSON.stringify.

      Returns Promise<T>

      The parsed JSON response (or raw text when json: false).

      HttpResponseError when the server returns HTTP status >= 400.

      HttpTimeoutError when the request exceeds the configured timeout.

      HttpRequestFailed for transport-level failures (network, DNS, socket, etc.).