httpotion elixir

Httpotion’s documentation is better than Httpoison, so that’s why I use Httpotion. IF YOUR DOCU SUCKS ASS I WONT USE YOUR STUFF.

response = HTTPotion.get "https://api.yelp.com/v3/businesses/search?term=food&location=45-09+34th+Ave+Long+Island+City+ny+11101&radius=50&price=1,2,3,4", [headers: ["Content-Type": "application/json", "Authorization": "Bearer #{my_token}"]]

response = HTTPotion.post "https://hooks.slack.com/services/a00000/b0000/XXXXXXX", [body: "{'channel': '#general', 'username': 'derp', 'text': 'Pokemon are scary!', 'icon_emoji': ':ghost:'}", headers: ["Content-Type": "application/json"]]

HTTPotion.Response.success?(response)

accessing the information… the internet says, who the fuck would want that?

Again in disbelief of how this is possible, but the internet doesn’t want you to know about this function..

derp = response |> Map.get(:body) |> Poison.decode
{:ok, derp2} = derp

Post Content