View Source Stellar.Horizon.Client.Spec behaviour (Elixir Stellar SDK v0.22.0)

Specifies expected behaviour of an HTTP client.

Stellar allows you to use your HTTP client of choice, provided that it can be coerced into complying with this module's specification. The default is :hackney.

Summary

Types

@type body() :: binary()
@type headers() :: [{binary(), binary()}, ...]
@type method() :: :get | :post | :put | :delete
@type options() :: Keyword.t()
@type response() :: {:ok, status(), headers()}
@type response_error() :: {:error, any()}
@type response_with_body() :: {:ok, status(), headers(), body()}
@type server() :: Stellar.Horizon.Server.t()
@type status() :: non_neg_integer()

Callbacks

Link to this callback

request(server, method, url, body, headers, options)

View Source
@callback request(
  server :: server(),
  method :: method(),
  url :: binary(),
  body :: binary(),
  headers :: headers(),
  options :: options()
) :: response() | response_with_body() | response_error()