Liking cljdoc? Tell your friends :D

dk.simongray.whatwg-url.params

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.
raw docstring

appendclj/s

(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.
sourceraw docstring

deleteclj/s

(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.
sourceraw docstring

getclj/s

(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.
sourceraw docstring

get-allclj/s

(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.
sourceraw docstring

has?clj/s

(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.
sourceraw docstring

parseclj/s

(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" ""]]
sourceraw docstring

serializeclj/s

(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"
sourceraw docstring

setclj/s

(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.
sourceraw docstring

sortclj/s

(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.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close