Set of recognised charsets by the current JVM
Set of recognised charsets by the current JVM
(default-handle-error e _ _)
Default error handling function used, which rethrows the Exception
Default error handling function used, which rethrows the Exception
(get-or-guess-charset req)
Tries to get the request encoding from the header or guess it if not given in Content-Type. Defaults to utf-8
Tries to get the request encoding from the header or guess it if not given in *Content-Type*. Defaults to *utf-8*
(make-type-request-pred regexp)
Function that returns a predicate fn checking if Content-Type request header matches a specified regexp and body is set.
Function that returns a predicate fn checking if *Content-Type* request header matches a specified regexp and body is set.
(parse-clojure-string s)
Decode a clojure body. The body is merged into the params, so must be a map or a vector of key value pairs. An empty body is safely handled.
Decode a clojure body. The body is merged into the params, so must be a map or a vector of key value pairs. An empty body is safely handled.
(wrap-clojure-params handler & args)
Handles body params in Clojure (edn) format. See wrap-format-params
for details.
Handles body params in Clojure (*edn*) format. See [[wrap-format-params]] for details.
(wrap-format-params handler & args)
Wraps a handler such that requests body are deserialized from to the right format, added in a :body-params key and merged in :params. It takes 4 args:
Wraps a handler such that requests body are deserialized from to the right format, added in a *:body-params* key and merged in *:params*. It takes 4 args: + **:predicate** is a predicate taking the request as sole argument to test if deserialization should be used. + **:decoder** specifies a fn taking the body String as sole argument and giving back a hash-map. + **:charset** can be either a string representing a valid charset or a fn taking the req as argument and returning a valid charset. + **:binary?** if true *:charset* will be ignored and decoder will receive an *InputStream* + **:handle-error** is a fn with a sig [exception handler request]. Return (handler obj) to continue executing a modified request or directly a map to answer immediately. Defaults to just rethrowing the Exception
(wrap-json-kw-params handler & args)
Handles body params in JSON format. Parses map keys as keywords.
See wrap-format-params
for details.
Handles body params in JSON format. Parses map keys as keywords. See [[wrap-format-params]] for details.
(wrap-json-params handler & args)
Handles body params in JSON format. See wrap-format-params
for details.
Handles body params in JSON format. See [[wrap-format-params]] for details.
(wrap-msgpack-kw-params handler & args)
Handles body params in msgpack format. Parses map keys as keywords.
See wrap-format-params
for details.
Handles body params in **msgpack** format. Parses map keys as keywords. See [[wrap-format-params]] for details.
(wrap-msgpack-params handler & args)
Handles body params in msgpack format.
See wrap-format-params
for details.
Handles body params in **msgpack** format. See [[wrap-format-params]] for details.
(wrap-restful-params handler & args)
Wrapper that tries to do the right thing with the request :body and provide
a solid basis for a RESTful API. It will deserialize to JSON, YAML, Transit
or Clojure depending on Content-Type header. See wrap-format-params
for
more details.
Options to specific format decoders can be passed in using :format-options
option. If should be map of format keyword to options map.
Wrapper that tries to do the right thing with the request :body and provide a solid basis for a RESTful API. It will deserialize to *JSON*, *YAML*, *Transit* or *Clojure* depending on Content-Type header. See [[wrap-format-params]] for more details. Options to specific format decoders can be passed in using *:format-options* option. If should be map of format keyword to options map.
(wrap-transit-json-params handler & args)
Handles body params in transit format over JSON. You can use an :options key to pass
a map with :handlers and :default-handler to transit-clj. See wrap-format-params
for details.
Handles body params in transit format over **JSON**. You can use an *:options* key to pass a map with *:handlers* and *:default-handler* to transit-clj. See [[wrap-format-params]] for details.
(wrap-transit-msgpack-params handler & args)
Handles body params in transit format over msgpack. You can use an :options key to pass
a map with :handlers and :default-handler to transit-clj. See wrap-format-params
for details.
Handles body params in transit format over **msgpack**. You can use an *:options* key to pass a map with *:handlers* and *:default-handler* to transit-clj. See [[wrap-format-params]] for details.
(wrap-yaml-kw-params handler & args)
Handles body params in YAML format. Parses map keys as keywords.
See wrap-format-params
for details.
Handles body params in YAML format. Parses map keys as keywords. See [[wrap-format-params]] for details.
(wrap-yaml-params handler & args)
Handles body params in YAML format. See wrap-format-params
for details.
Handles body params in YAML format. See [[wrap-format-params]] for details.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close