Library for parsing and constructing URLs
Query: A Dict that holds keys and values for the query string
Parse a url string, returns an Erl.Url record
Erl.parse "http://api.example.com/users/1#x/1?a=1" == Erl.Url{...}Extract the fragment (hash) from the url
Extract the host from the url
Extract the path from the url
Extract the protocol from the url
Extract the port from the url
Extract the query string from the url
Generate url string from an Erl.Url record
url = {
protocol = "http",
username = "",
password = "",
host = ["www", "foo", "com"],
path = ["users", "1"],
port' = 2000,
fragment = ["a", "b"],
query = Dict.empty |> Dict.insert "q" "1" |> Dict.insert "k" "2"
}
Erl.toString url == "http://www.foo.com:2000/users/1#a/b?k=2&q=1"
Url: record that holds url attributes