Core HTTP request engine shared by every resource module: URL/query/body encoding, bearer auth, jittered exponential-backoff retries on transient (429/5xx/network) failures, and a single automatic refresh-and-retry on 401s when the client has a token store configured.
This module is considered internal; resource modules like Monzo.Accounts
are the intended public API.
Summary
Functions
Executes a request against the Monzo API described by opts, using the
given Monzo.Client for configuration (base URL, adapter, token store,
retry policy, etc), and returns the JSON-decoded response body.
Types
@type body_encoding() :: :none | :form | :json
@type method() :: :get | :post | :put | :patch | :delete
Functions
@spec request(Monzo.Client.t(), request_opts()) :: {:ok, term()} | {:error, Exception.t()}
Executes a request against the Monzo API described by opts, using the
given Monzo.Client for configuration (base URL, adapter, token store,
retry policy, etc), and returns the JSON-decoded response body.