Mercadopago.HTTP (mercadopago_sdk_elixir v0.1.0)

Copy Markdown View Source

Req-based HTTP transport. Retries GET on transient errors; no retry for mutating verbs.

Summary

Types

Result of an API call. {:ok, ...} carries the HTTP status and the parsed JSON body (a map, a list, or nil for empty bodies). {:error, reason} is returned for transport-level failures (timeouts, connection errors).

Functions

GET request with optional query params and per-call opts (e.g. access_token:).

POST request. Omit body or pass nil to send no body.

Types

response()

@type response() ::
  {:ok, %{status: non_neg_integer(), response: map() | list() | nil}}
  | {:error, term()}

Result of an API call. {:ok, ...} carries the HTTP status and the parsed JSON body (a map, a list, or nil for empty bodies). {:error, reason} is returned for transport-level failures (timeouts, connection errors).

Functions

delete(client, uri, opts \\ [])

@spec delete(Mercadopago.Client.t(), String.t(), keyword()) :: response()

DELETE request.

get(client, uri, params \\ nil, opts \\ [])

@spec get(Mercadopago.Client.t(), String.t(), map() | nil, keyword()) :: response()

GET request with optional query params and per-call opts (e.g. access_token:).

post(client, uri, body, opts \\ [])

@spec post(Mercadopago.Client.t(), String.t(), map() | nil, keyword()) :: response()

POST request. Omit body or pass nil to send no body.

put(client, uri, body, opts \\ [])

@spec put(Mercadopago.Client.t(), String.t(), map() | nil, keyword()) :: response()

PUT request.