(default-val-transform _ v)
Default transformation that is used on params' values
Default transformation that is used on params' values
(defrest definition & {:keys [] :as args})
Defines multiple functions based on definition map. For map's structure see docs.
Valid definition parameters any of the following: map literal, a symbol (naming a var that resolves to a map), a string URL.
URL string can use classpath:
or file:
protocol.
Definition can be followed by opts key-value arguments, all of them are optional.
:param-transform
This option specifies function that is uset to transform query parameter names: parameter name (symbol) -> query parameter name (string). Default identity
.
:val-transform
This option specifies a function that is applied to all arguments after argument spec and conform and before being embedded into
request map. It's a function of two arguments: param name symbol and param value, returns new param value.
Defaults to a function that converts keywords to a string name (no ns).
:json-bodies
If true then body parameters are sent as to-JSON serialized form params, otherwise body params are simply added to request as :body
. Default true.
:json-responses
If true then all requests specify {:as :json}
and all responses are expected to be json responses. Default true.
Defines multiple functions based on definition map. For map's structure see docs. Valid definition parameters any of the following: map literal, a symbol (naming a var that resolves to a map), a string URL. URL string can use `classpath:` or `file:` protocol. Definition can be followed by opts key-value arguments, all of them are optional. `:param-transform` This option specifies function that is uset to transform query parameter names: parameter name (symbol) -> query parameter name (string). Default `identity`. `:val-transform` This option specifies a function that is applied to all arguments after argument spec and conform and before being embedded into request map. It's a function of two arguments: param name symbol and param value, returns new param value. Defaults to a function that converts keywords to a string name (no ns). `:json-bodies` If true then body parameters are sent as to-JSON serialized form params, otherwise body params are simply added to request as `:body`. Default true. `:json-responses` If true then all requests specify `{:as :json}` and all responses are expected to be json responses. Default true.
(defrest-map definition
{:keys [json-responses json-bodies param-transform val-transform]
:or {json-responses true json-bodies true}})
(parse-vars uri)
Parse URI into alternating fixed strings and vars.
Parse URI into alternating fixed strings and vars.
(prefix-middleware url-prefix)
Function for creating a clj-http middleware that prepends to url.
Function for creating a clj-http middleware that prepends to url.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close