HTTPoison
mix deps.update hackney for quick fix
HTTPoison uses hackney to execute HTTP requests instead of ibrowse
{:httpoison, "~> 1.6"}Usage
Get
{:ok, response} = HTTPoison.get(url, headers, options)
url = "https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token=" <> gaccess_token
%HTTPoison.Response{status_code: 200, body: body} = HTTPoison.get!(url, [])
profile = Jason.decode!(body)iex> HTTPoison.start
iex> HTTPoison.get! "http://httparrot.herokuapp.com/get"
iex> HTTPoison.get! "http://localhost:1"
** (HTTPoison.Error) :econnrefused
iex> HTTPoison.get "http://localhost:1"
{:error, %HTTPoison.Error{id: nil, reason: :econnrefused}}Post
iex
Pattern Match
Authorization
Basic
Bearer
Last updated