HTTPoison not started in interactive session...?
Closed this issue · 3 comments
psfblair commented
I'm pretty new to Elixir, so maybe this is just my ignorance, but when I tried the following in iex (with a running Datomic peer):
Datomex.start_link "localhost", 8001, "dev", "mbrainz-1968-1973"
Datomex.databases
I would get
** (exit) exited in: :gen_server.call(:hackney_manager, {:new_request, #PID<0.158.0>, #Reference<0.0.1.1624>, {:client, :undefined, :hackney_dummy_metrics, :hackney_tcp_transport, 'localhost', 8001, "localhost:8001", [], nil, nil, nil, true, :hackney_pool, 5000, false, 5, false, 5, nil, nil, nil, :undefined, :start, nil, :normal, false, false, false, :undefined, false, nil, :waiting, nil, 4096, "", [], :undefined, nil, nil, nil, nil, :undefined, nil}}, :infinity)
** (EXIT) no process
(stdlib) gen_server.erl:212: :gen_server.call/3
src/hackney_manager.erl:66: :hackney_manager.init_request/1
src/hackney_manager.erl:56: :hackney_manager.new_request/1
src/socket/hackney_connect.erl:183: :hackney_connect.socket_from_pool/4
src/socket/hackney_connect.erl:36: :hackney_connect.connect/5
src/hackney.erl:321: :hackney.request/5
lib/httpoison/base.ex:394: HTTPoison.Base.request/9
I was able to solve the problem by first calling
HTTPoison.start
Is this the way it's supposed to work?
edubkendo commented
It's been a while, but I think you can add HTTPoison to the applications list in mix.exs and have it started automatically.
psfblair commented
Thanks; that works. Just sent a pull request to update the README.
edubkendo commented
Awesome!