Skip to content

Commit

Permalink
Merge pull request #69 from killerswan/req-opts
Browse files Browse the repository at this point in the history
read and use additional :request_options on request!/5
  • Loading branch information
duksis committed Mar 28, 2016
2 parents 7f0914f + 65e8c9f commit f954f84
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit f954f84

Please # to comment.