ex_easypost v1.0.0 ExEasyPost.Client.HTTP behaviour

Specifies expected behaviour of an HTTP client.

ExEasyPost allows you to use your HTTP client of choice, provided that it can be coerced into complying with this modules’s specification.

The default client is :httpoison.

Link to this section Summary

Link to this section Types

Link to this type http_method()
http_method() :: :get | :post | :put | :delete

Link to this section Callbacks

Link to this callback request(method, url, req_body, headers, http_opts)
request(method :: http_method(), url :: binary(), req_body :: binary(), headers :: [{binary(), binary()}, ...], http_opts :: term()) ::
  {:ok, %{status_code: pos_integer(), body: binary()}} |
  {:error, %{reason: any()}}