Is the URI absolute? Returns true if the URI has a scheme (protocol), and hence also an origin.
Is the URI absolute? Returns true if the URI has a scheme (protocol), and hence also an origin.
(assoc-query u & {:as kvs})
Add additional query parameters to a URI. Takes a URI (or coercible to URI) followed key value pairs.
(assoc-query "http://example.com?id=1&name=John" :name "Jack" :style "goth") ;;=> #lambdaisland/uri "http://example.com?id=1&name=Jack&style=goth"
Add additional query parameters to a URI. Takes a URI (or coercible to URI) followed key value pairs. (assoc-query "http://example.com?id=1&name=John" :name "Jack" :style "goth") ;;=> #lambdaisland/uri "http://example.com?id=1&name=Jack&style=goth"
(assoc-query* u m)
Add additional query parameters to a URI. Takes a URI (or coercible to URI) and a map of query params.
Add additional query parameters to a URI. Takes a URI (or coercible to URI) and a map of query params.
A map that can be passed to clojure.edn/read, so tagged URI literals are read back correctly.
A map that can be passed to clojure.edn/read, so tagged URI literals are read back correctly.
(join & uris)
Joins any number of URIs as per RFC3986. Arguments can be strings, they will be coerced to URI records.
Joins any number of URIs as per RFC3986. Arguments can be strings, they will be coerced to URI records.
(join* base ref)
Join two URI records as per RFC 3986. Handles relative URIs.
Join two URI records as per RFC 3986. Handles relative URIs.
(map->query-string m)
Convert a map into a query string, consisting of key=value pairs separated by
&
. The result is percent-encoded so it is always safe to use. Keys can be
strings or keywords. If values are collections then this results in multiple
entries for the same key. nil
values are ignored. Values are stringified.
Convert a map into a query string, consisting of key=value pairs separated by `&`. The result is percent-encoded so it is always safe to use. Keys can be strings or keywords. If values are collections then this results in multiple entries for the same key. `nil` values are ignored. Values are stringified.
(parse uri)
Parse a URI string into a lambadisland.uri.URI record.
Parse a URI string into a lambadisland.uri.URI record.
(query-encode s)
Percent encoding for query strings. Will percent-encode values that are reserved in query strings only. Encodes spaces as +.
Percent encoding for query strings. Will percent-encode values that are reserved in query strings only. Encodes spaces as +.
(query-map uri)
(query-map u opts)
Return the query section of a URI as a map. Will coerce its argument
with uri
. Takes an options map, see query-string->map
for options.
Return the query section of a URI as a map. Will coerce its argument with [[uri]]. Takes an options map, see [[query-string->map]] for options.
(query-string->map q)
(query-string->map q
{:keys [multikeys keywordize?]
:or {multikeys :duplicates keywordize? true}})
Parse a query string, consisting of key=value pairs, separated by "&". Takes the following options:
:keywordize?
whether to turn return keys as keywords. Defaults to true
.:multikeys
how to handle the same key occuring multiple times, defaults to
:duplicates
The possible values for :multikeys
are
:never
always return a single value for a key. The rightmost value
"wins":always
return a map with vectors as values, with successive
values of the same key in order:duplicates
return a vector for keys that occur multiple times, or a
string otherwiseParse a query string, consisting of key=value pairs, separated by "&". Takes the following options: - `:keywordize?` whether to turn return keys as keywords. Defaults to `true`. - `:multikeys` how to handle the same key occuring multiple times, defaults to `:duplicates` The possible values for `:multikeys` are - `:never` always return a single value for a key. The rightmost value "wins" - `:always` return a map with vectors as values, with successive values of the same key in order - `:duplicates` return a vector for keys that occur multiple times, or a string otherwise
(relative? uri)
Is the URI relative? Returns true if the URI does not have a scheme (protocol).
Is the URI relative? Returns true if the URI does not have a scheme (protocol).
(uri uri-like)
Turn the given value into a lambdaisland.uri.URI record, if it isn't one
already. Supports String, java.net.URI, and other URI-like objects that return
a valid URI string with str
.
Turn the given value into a lambdaisland.uri.URI record, if it isn't one already. Supports String, java.net.URI, and other URI-like objects that return a valid URI string with `str`.
(uri-str {:keys [scheme user password host port path query fragment]})
Convert the URI instance back to a string
Convert the URI instance back to a string
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close