Resty v0.12.0 Resty.Connection.HTTPoison View Source

Default Resty.Connection implementation. It will use HTTPoison in order to query the web API.

Params

All the parameters will be sent to HTTPoison as the options you can know more about the supported options here: HTTPoison.Request

Usage

As this is the default you should not have to manually set it except if you have changed the default connection in your config.exs file or if you want to set specific options/params.

defmodule MyResource do
  use Resty.Resource.Base

  set_connection Resty.Connection.HTTPoison, timeout: 8000
end

You can also define in your config.exs file default options to be sent with each request.

config :resty, Resty.Connection.HTTPoison, timeout: 8000

Thus making it possible to use Resty.Resource.Base.set_connection/1

defmodule MyResource do
  use Resty.Resource.Base

  set_connection Resty.Connection.HTTPoison
end