View Source Instream.HTTPClient behaviour (Instream v2.0.0)

Behaviour definition for switchable HTTP clients.

Link to this section Summary

Link to this section Types

@type method() :: :get | :head | :post
@type response() ::
  {:ok, status :: pos_integer(), headers :: list()}
  | {:ok, status :: pos_integer(), headers :: list(), body :: binary()}
  | {:error, term()}

Link to this section Callbacks

Link to this callback

request( method, url, headers, body, opts )

View Source
@callback request(
  method :: method(),
  url :: binary(),
  headers :: list(),
  body :: binary(),
  opts :: list()
) :: response()