Task

Access and print a URL's content (the located resource) to the console.

There is a separate task for HTTPS Requests.




 
-module(main).
-export([main/1]).
 
main([Url|[]]) ->
   inets:start(),
   case http:request(Url) of
       {ok, {_V, _H, Body}} -> io:fwrite("~p~n",[Body]);
       {error, Res} -> io:fwrite("~p~n", [Res])
   end.
 