View Source Unleash.HTTPClientAdapter behaviour (Unleash v1.12.5)

Behaviour that all http clients must implement in order to be compatible

Summary

Types

@type error_reason() :: any()
@type header() :: {String.t(), String.t()}
@type headers() :: [header()]
@type response() :: %{status: non_neg_integer(), headers: headers(), body: map()}

Callbacks

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

post(url, headers, body)

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