pagantis_elixir_tools v0.21.3 ElixirTools.HttpClient

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

Link to this section Summary

Link to this section Types

Specs

action() :: :get | :create | :update

Specs

adapter() :: module()

Specs

base_uri() :: String.t()

Specs

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

Specs

path() :: String.t()

Specs

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

Specs

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

Specs

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

request_body()

Specs

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

response_body()

Specs

response_body() :: HTTPoison.Response.t()

Specs

uri() :: URI.t()

Link to this section Functions

Link to this function

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

Specs

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

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

Specs

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

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

Specs

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