Tinkex.HTTPClient behaviour (Tinkex v0.3.4)

View Source

Behaviour for HTTP client implementations.

This indirection lets tests or host applications swap out the HTTP layer when needed. The default implementation is Tinkex.API.

Summary

Callbacks

delete(path, opts)

@callback delete(path :: String.t(), opts :: keyword()) ::
  {:ok, map()} | {:error, Tinkex.Error.t()}

get(path, opts)

@callback get(path :: String.t(), opts :: keyword()) ::
  {:ok, map()} | {:error, Tinkex.Error.t()}

post(path, body, opts)

@callback post(path :: String.t(), body :: map(), opts :: keyword()) ::
  {:ok, map()} | {:error, Tinkex.Error.t()}