yuri
An LFE library for working with URIs
About ↟
This library is serves a handful of purposes:
- provides additional parsing of URI data on top of what the Erlang
uri_stringlibrary already does; - does conversions for bytestring URIs
- provides a URI encode function
- wraps some basic
uri_stringfunctions (likeparse) for convenience
Build ↟
rebar3 lfe compile
Tests ↟
rebar3 as test ltest
Usage ↟
lfe> (set parsed (yuri:parse "https://example.tld/some/path?a=1&b=2#name"))
#M(fragment #"name"
host #"example.tld"
path #"/some/path"
query #"a=1&b=2"
scheme #"https")
lfe> (yuri.path:->segments parsed)
(#"some" #"path")
lfe> (yuri.path:->segments "/some/path")
(#"some" #"path")
lfe> (yuri.path:->segments #"/some/path")
(#"some" #"path")
lfe> (set query (yuri.query:parse parsed))
#M(#"a" #"1" #"b" #"2")
lfe> (mref query #"b")
#"2"
License ↟
Apache License, Version 2.0
Copyright © 2023, Duncan McGreggor oubiwann@gmail.com.