Created
February 27, 2019 02:56
-
-
Save Yoosuke/74b1c101b3c8c70e7747b0bbe4d659d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Aedmap.ExJson do | |
def get(base_url, resource_path) do | |
case (base_url <> resource_path) |> HTTPoison.get! do | |
%HTTPoison.Response{body: body, status_code: 200} -> body |> Poison.decode! | |
%HTTPoison.Error{reason: reason} -> raise "Oops, #{reason}" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment