https://github.com/oarrabi/exrequester
For example, this is a quick sample API Client.
defmodule SampleAPI do
use EXRequester
@headers [
Authorization: :auth,
Accept: "application/json",
"Accept-Language": "en-US"
]
@get "/path/to/resource/{resource_id}"
defreq get_resource(resource_id: resource_id, auth: auth)
end
And now you can call it with: SampleAPI.client("http://base_url.com")
|> SampleAPI.get_resource(resource_id: 123, auth1: "1")