Shared HTTP client used by all Setu SDK sub-modules.
Layers over Finch with rate limiting, full-jitter exponential backoff,
structured SetuClient.Error decoding, and :telemetry spans.
Summary
Functions
Executes a JSON API request and decodes a 2xx response into a map.
Executes an HTTP request with retry and rate limiting.
Types
@type raw_response() :: %{ status: non_neg_integer(), headers: [{String.t(), String.t()}], body: String.t() }
Functions
@spec json_request( atom(), String.t(), [{String.t(), String.t()}], map() | nil, SetuClient.Config.t() ) :: {:ok, map()} | {:error, SetuClient.Error.t()}
Executes a JSON API request and decodes a 2xx response into a map.
Returns {:ok, map()} or {:error, %SetuClient.Error{}}.
@spec request( atom(), String.t(), [{String.t(), String.t()}], String.t() | nil, SetuClient.Config.t() ) :: {:ok, raw_response()} | {:error, SetuClient.Error.t()}
Executes an HTTP request with retry and rate limiting.
Returns {:ok, raw_response()} or {:error, %SetuClient.Error{}}.