pagantis_elixir_tools v0.19.1 ElixirTools.HttpClient

The HttpClient module handles HTTP(s) interactions with remote services.

Link to this section Summary

Link to this section Types

Link to this type

action()

action() :: :get | :create | :update
Link to this type

adapter()

adapter() :: module()
Link to this type

base_uri()

base_uri() :: String.t()
Link to this type

header()

header() :: {String.t(), String.t()}
Link to this type

path()

path() :: String.t()
Link to this type

post_opt()

post_opt() ::
  {:headers, [header()]}
  | {:http_client, module()}
  | {:retry, boolean()}
  | {:headers_to_add, [header()]}
Link to this type

put_opt()

put_opt() ::
  {:headers, [header()]} | {:http_client, module()} | {:retry, boolean()}
Link to this type

query()

query() :: String.t()
Link to this type

request_body()

request_body() :: String.t()
Link to this type

response_body()

response_body() :: HTTPoison.Response.t()
Link to this type

uri()

uri() :: URI.t()

Link to this section Functions

Link to this function

get(adapter, path, opts \\ [])

get(adapter(), path(), [post_opt()]) ::
  {:ok, response_body()} | {:error, term()}
Link to this function

post(adapter, path, request_body, opts \\ [])

post(adapter(), path(), request_body(), [post_opt()]) ::
  {:ok, response_body()} | {:error, term()}
Link to this function

put(adapter, path, request_body, opts \\ [])

put(adapter(), path(), request_body(), [put_opt()]) ::
  {:ok, response_body()} | {:error, term()}