elixer get request code example
Example: http get elixir
# set HTTPoison, Jason
def deps do
[
{:httpoison, "~> 1.6"},
{:jason, "~> 1.0"},
]
end
# use HTTPoison
HTTPoison.get!("https://api.github.com")
%HTTPoison.Response{status_code: 200,
headers: [{"content-type", "application/json"}],
body: "{...}"}
# use Jason
Jason.encode!(%{"age" => 44})
"{\"age\":44}"
Jason.decode!(~s({"age":44}))
%{"age" => 44}