Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
9
Task/HTTP/Erlang/http-1.erl
Normal file
9
Task/HTTP/Erlang/http-1.erl
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
-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.
|
||||
11
Task/HTTP/Erlang/http-2.erl
Normal file
11
Task/HTTP/Erlang/http-2.erl
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
-module(main).
|
||||
-export([main/1]).
|
||||
|
||||
main([Url|[]]) ->
|
||||
inets:start(),
|
||||
http:request(get, {Url, [] }, [], [{sync, false}]),
|
||||
receive
|
||||
{http, {_ReqId, Res}} -> io:fwrite("~p~n",[Res]);
|
||||
_Any -> io:fwrite("Error: ~p~n",[_Any])
|
||||
after 10000 -> io:fwrite("Timed out.~n",[])
|
||||
end.
|
||||
1
Task/HTTP/Erlang/http-3.erl
Normal file
1
Task/HTTP/Erlang/http-3.erl
Normal file
|
|
@ -0,0 +1 @@
|
|||
|escript ./req.erl http://www.rosettacode.org
|
||||
Loading…
Add table
Add a link
Reference in a new issue