diff options
Diffstat (limited to 'lib/zendex/common_helpers.ex')
-rw-r--r-- | lib/zendex/common_helpers.ex | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/zendex/common_helpers.ex b/lib/zendex/common_helpers.ex index 34aac30..dceb56d 100644 --- a/lib/zendex/common_helpers.ex +++ b/lib/zendex/common_helpers.ex @@ -5,4 +5,11 @@ defmodule Zendex.CommonHelpers do def decode_response(%{body: body}), do: Poison.decode!(body) + def get_headers(authentication) do + [{"Authorization", "Basic #{authentication}"}] + end + + def get_headers(authentication, %{content_type: :json}) do + get_headers(authentication) ++ [{"Content-Type", "application/json"}] + end end |