概要
paiza.ioでelixirやってみた。
httpでgetやってみた。
サンプルコード
:inets.start
:ssl.start
{:ok, {_, _, body}} = :httpc.request(["https://ohiapp0.herokuapp.com/ipinfo"])
body
#|> Jason.decode!()
|> IO.puts
実行結果
{"host":"ohiapp0.herokuapp.com","connection":"close","x-request-id":"c85628e2-fd7d-4d0d-b933-bb516a5b014c","x-forwarded-for":"13.231.7.231","x-forwarded-proto":"https","x-forwarded-port":"443","via":"1.1 vegur","connect-time":"0","x-request-start":"1666660384815","total-route-time":"0"}
成果物
以上。