The low-level HTTP transport shared by every resource module.
Built on Erlang/OTP's built-in :httpc (+ :ssl) so the package has zero
required HTTP-client dependencies. Handles:
- bearer token attachment (via
Ramp.TokenManager) - JSON encoding/decoding (via
Jason) - automatic retry with exponential backoff + full jitter on network
errors and retryable
429/5xxresponses (honoringRetry-After) - automatic one-time token refresh + retry on
401 Idempotency-Keyheader propagationx-trace-idpropagation into errors, for support escalations:telemetryevents around every attempt
You won't normally call this module directly -- use the resource modules
(Ramp.Cards, Ramp.Users, etc.) instead. It's public because it's
useful for writing your own thin wrappers around undocumented or brand
new Ramp endpoints this SDK doesn't have a typed module for yet:
Ramp.HTTP.request(client, :get, "/developer/v1/some-new-endpoint")
Summary
Functions
Performs an HTTP request against the Ramp API and returns the decoded JSON body.
Types
Functions
@spec request(Ramp.Client.t(), method(), String.t(), [request_opt()]) :: {:ok, term()} | {:error, Ramp.Error.t()}
Performs an HTTP request against the Ramp API and returns the decoded JSON body.
Options
:query- query parameters (keyword list or map);nilvalues are dropped:json- request body to JSON-encode; omit/nilfor no body:idempotency_key- sent as theIdempotency-Keyheader when present
Returns {:ok, decoded_body_or_nil} on any 2xx response (nil for
204/empty bodies), or {:error, %Ramp.Error{}} otherwise.