Current section

Files

Jump to
smallex lib json.ex
Raw

lib/json.ex

defmodule Json do
def call( domain, path, header, map_function ) do
domain <> path
|> HTTPoison.get!( header )
|> body
|> Poison.decode!
|> map_function.()
end
def body( %{ status_code: 200, body: body } ), do: body
end