-module(main).
-export([call_api/0]).
call_api() ->
{ok, Body} = httpc:request(get, {"http://api.ipify.org", []}, [], []),
Body.
hi erlang noobie here, I’d like to understand what I am doing wrong here?
I also tried it like this
call_api() ->
{ok, Body} = httpc:request(get, {"http://api.ipify.org"}),
Body.
but its throwing the following error:
** exception error: no function clause matching httpc:request(get,{get,[]},[],[],{“http://api.ipify.org”,[]}) (httpc.erl, line 157)
in function main:call_api/0 (main.erl, line 5)