1
0
Fork 0
mirror of https://github.com/correl/urilib.git synced 2025-03-17 17:00:13 -09:00

Update the README

This commit is contained in:
Gavin M. Roy 2016-01-21 23:09:37 -05:00
parent 56c320572f
commit f0b3920a0f

View file

@ -6,12 +6,18 @@ urilib
Example Usage
-------------
```erlang
-include_lib("urilib.h").
Eshell V7.2.1 (abort with ^G)
1> urilib:build({http, {{"guest", "guest"}, "localhost", 15672}, "/api/queues", [{"name", "test"}], undefined}).
"http://guest:guest@localhost:15672/api/queues?name=test"
URI = urilib:parse("http://foo:bar@www.google.com/search?baz=qux#corgie"),
io:format("Parsed URI: ~p~n", [URI]).
2> urilib:build({http, "guest", "guest", "localhost", 15672, "/api/queues", [{"name", "test"}], undefined}).
"http://guest:guest@localhost:15672/api/queues?name=test"
URL = urllib:build({http, undefined, undefined, "www.google.com", undefined, "/search", [{"foo", "bar"}], "baz"}),
io:format("Built URL: ~s~n", [URL]).
3> urilib:parse("http://guest:guest@localhost:15672/api/queues?name=test").
{http,{{"guest","guest"},"localhost",15672},
"/api/queues",
[{"name","test"}],
undefined}
```