GotenbergElixir.HttpClient.Behaviour behaviour (Gotenberg Elixir v0.1.1)

Copy Markdown View Source

Behaviour for HTTP client implementations.

Summary

Types

body()

@type body() :: binary() | {:multipart, list()}

error()

@type error() :: %{reason: atom() | String.t(), message: String.t()}

headers()

@type headers() :: [{String.t(), String.t()}] | %{required(String.t()) => String.t()}

response()

@type response() :: %{status: integer(), headers: headers(), body: binary()}

Callbacks

get(url, headers)

@callback get(url :: String.t(), headers :: headers()) ::
  {:ok, response()} | {:error, error()}

post(url, body, headers)

@callback post(url :: String.t(), body :: body(), headers :: headers()) ::
  {:ok, response()} | {:error, error()}