summaryrefslogtreecommitdiff
path: root/lib/http_client.ex
blob: 6d18cbe7cbda874ffb7b56bb93263c5604ab2156 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
defmodule PowerDNSex.HttpClient do
  @moduledoc"""
  Client to do http requests for PowerDns API
  """

  use HTTPoison.Base

  alias PowerDNSex.Config

  def process_url(url) do
    Config.powerdns_url <> url
  end

  defp process_request_headers(headers) do
    custom = ["X-API-Key": Config.powerdns_token]
    Enum.into(headers, custom)
  end
end