Skir.RPC.HTTPClient behaviour (skir_elixir_client v0.2.2)

Copy Markdown View Source

Transport behaviour used by Skir.RPC.ServiceClient.

Implement this behaviour to use Finch, Req, Tesla, Mint, or another HTTP stack. The built-in adapter uses bounded OTP TCP/TLS reads and its HTTP header parser.

Summary

Callbacks

Sends an HTTP request and returns the status, headers, and binary body, or a transport error.

Types

header()

@type header() :: {String.t(), String.t()}

response()

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

Callbacks

request(arg1, t, list, binary, keyword)

@callback request(:get | :post, String.t(), [header()], binary(), keyword()) ::
  {:ok, response()} | {:error, term()}

Sends an HTTP request and returns the status, headers, and binary body, or a transport error.