Skip to content

Commit

Permalink
allow dynamic passing of :http client in fetch_xml function p.288 #1
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Aug 11, 2019
1 parent 6aea929 commit f81e401
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/info_sys/lib/info_sys/wolfram.ex
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ defmodule InfoSys.Wolfram do
[%Result{backend: __MODULE__, score: 95, text: to_string(answer)}]
end

@http Application.get_env(:info_sys, :wolfram)[:http_client] || :httpc
defp fetch_xml(query) do
{:ok, {_, _, body}} = :httpc.request(String.to_charlist(url(query)))
{:ok, {_, _, body}} = @httpc.request(String.to_charlist(url(query)))

body
end
Expand Down

0 comments on commit f81e401

Please sign in to comment.