Codat.HTTP.Client (codat v1.0.0)

Copy Markdown View Source

Low-level HTTP client for the Codat API, built on Req + Finch.

Handles authentication, retries, rate-limit awareness, telemetry, and structured %Codat.Error{} on all failure paths. Internal — use the high-level solution API modules instead.

Summary

Functions

Performs a DELETE request.

Performs a GET request.

Types

method()

@type method() :: :get | :post | :put | :patch | :delete

response()

@type response() :: {:ok, map() | list() | binary() | nil} | {:error, Codat.Error.t()}

Functions

delete(config, path, opts \\ [])

@spec delete(Codat.Config.t(), String.t(), keyword()) :: response()

Performs a DELETE request.

get(config, path, opts \\ [])

@spec get(Codat.Config.t(), String.t(), keyword()) :: response()

Performs a GET request.

patch(config, path, body \\ %{}, opts \\ [])

@spec patch(Codat.Config.t(), String.t(), map(), keyword()) :: response()

Performs a PATCH request.

post(config, path, body \\ %{}, opts \\ [])

@spec post(Codat.Config.t(), String.t(), map() | list() | binary(), keyword()) ::
  response()

Performs a POST request.

put(config, path, body \\ %{}, opts \\ [])

@spec put(Codat.Config.t(), String.t(), map() | list(), keyword()) :: response()

Performs a PUT request.