Anonymous user
HTTP: Difference between revisions
m
Updated URL and whitespace.
m (Updated URL.) |
m (Updated URL and whitespace.) |
||
Line 819:
=={{header|Erlang}}==
===Synchronous===
<lang erlang>-module(main).
-export([main/1]).
Line 828 ⟶ 827:
{ok, {_V, _H, Body}} -> io:fwrite("~p~n",[Body]);
{error, Res} -> io:fwrite("~p~n", [Res])
end.</lang>
===Asynchronous===
<lang erlang>-module(main).
-export([main/1]).
main([Url|[]]) ->
inets:start(),
Line 843 ⟶ 838:
_Any -> io:fwrite("Error: ~p~n",[_Any])
after 10000 -> io:fwrite("Timed out.~n",[])
end.</lang>
Using it
▲|escript ./req.erl http://www.rosettacode.org
=={{header|F_Sharp|F#}}==
|