Query strings and form bodies in application/x-www-form-urlencoded, by the URL Standard, section 5, with the methods of URLSearchParams from section 6.2.
The pairs are a vector of name-value vectors in order, in which a name can come more than once. Each function also takes a map or any other seq of pairs, e.g. {:q "clojure" :page 2}. A keyword is read as its name (:q as q) and any other value as its text.
Query strings and form bodies in application/x-www-form-urlencoded, by
the URL Standard, section 5, with the methods of URLSearchParams from
section 6.2.
The pairs are a vector of name-value vectors in order, in which a name
can come more than once. Each function also takes a map or any other seq
of pairs, e.g. {:q "clojure" :page 2}. A keyword is read as its name
(:q as q) and any other value as its text.(append pairs name value)The pairs with the pair of name and value at the end.
The `pairs` with the pair of `name` and `value` at the end.
(delete pairs name)(delete pairs name value)The pairs without those that have the name, and the value when one
is given.
The `pairs` without those that have the `name`, and the `value` when one is given.
(get pairs name)The value of the first pair of pairs with the name, or nil.
The value of the first pair of `pairs` with the `name`, or nil.
(get-all pairs name)The values of each pair of pairs with the name, in order.
The values of each pair of `pairs` with the `name`, in order.
(has? pairs name)(has? pairs name value)Whether pairs has a pair with the name, and the value when one is
given.
Whether `pairs` has a pair with the `name`, and the `value` when one is given.
(parse s)The name-value pairs of the application/x-www-form-urlencoded text s,
e.g. the query of a URL. A + reads as a space. A name without = has an
empty value.
(parse "q=clojure+podcasts&page=2&debug")
;; => [["q" "clojure podcasts"] ["page" "2"] ["debug" ""]]
The name-value pairs of the application/x-www-form-urlencoded text `s`,
e.g. the query of a URL. A + reads as a space. A name without = has an
empty value.
(parse "q=clojure+podcasts&page=2&debug")
;; => [["q" "clojure podcasts"] ["page" "2"] ["debug" ""]](serialize pairs)The pairs as application/x-www-form-urlencoded text, leaving out any
pair whose value is nil.
(serialize {:q "clojure podcasts" :page 2})
;; => "q=clojure+podcasts&page=2"
The `pairs` as application/x-www-form-urlencoded text, leaving out any
pair whose value is nil.
(serialize {:q "clojure podcasts" :page 2})
;; => "q=clojure+podcasts&page=2"(set pairs name value)The pairs with the first pair of the name set to value and any
later pairs of the name removed. When no pair has the name, the new pair
goes at the end.
The `pairs` with the first pair of the `name` set to `value` and any later pairs of the name removed. When no pair has the name, the new pair goes at the end.
(sort pairs)The pairs sorted by name in the order of UTF-16 code units. The pairs
of a name keep their order.
The `pairs` sorted by name in the order of UTF-16 code units. The pairs of a name keep their order.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |