To start your new Phoenix application:
- Install dependencies with
mix deps.get
- Start Phoenix router with
mix phoenix.start
Now you can visit localhost:4000
from your browser.
https://github.com/phoenixframework/phoenix
https://github.com/edgurgel/httpoison
# In iex -S mix
import HTTPoison
HTTPoison.start
case HTTPoison.get(url) do
{:ok, %HTTPoison.Response{status_code: 200, body: body}} ->
IO.puts body
{:ok, %HTTPoison.Response{status_code: 404}} ->
IO.puts "Not found :("
{:error, %HTTPoison.Error{reason: reason}} ->
IO.inspect reason
end