Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

read and use additional :request_options on request!/5 #69

Merged
merged 2 commits into from
Mar 28, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/tentacat.ex
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ defmodule Tentacat do
end

def json_request(method, url, body \\ "", headers \\ [], options \\ []) do
request!(method, url, JSX.encode!(body), headers, options) |> process_response
raw_request(method, url, JSX.encode!(body), headers, options)
end

def raw_request(method, url, body \\ "", headers \\ [], options \\ []) do
request!(method, url, body, headers, options) |> process_response
extra_options = Application.get_env(:tentacat, :request_options, [])
request!(method, url, body, headers, extra_options ++ options) |> process_response
end

@spec url(client :: Client.t, path :: binary) :: binary
Expand Down