Current section
Files
Jump to
Current section
Files
lib/resty/connection.ex
defmodule Resty.Connection do
@moduledoc """
Connection are used by Resty in order to query the web API.
By default Resty will use `Resty.Connection.HTTPoison` but if you want to
use another HTTP client you'll have to write your own connection
implementation.
Once that's done you'll be able to use it on a per resource basis by calling
the appropriate `Resty.Resource.Base` macro or globally by setting it in the
config.
"""
@doc false
def send(request, resource_module) do
{implementation, params} = resource_module.connection()
request |> implementation.send(params)
end
end