Liking cljdoc? Tell your friends :D

ring.middleware.format-params


get-charsetclj

(get-charset {:keys [content-type]})

Extracts charset from Content-Type header. utf-8 by default.

Extracts charset from Content-Type header. utf-8 by default.
raw docstring

json-parse-stringclj

(json-parse-string s)

json-request?clj


make-type-request-predclj

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

wrap-format-paramsclj

(wrap-format-params handler & {:keys [predicate decoder charset]})

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 3 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.

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

wrap-json-paramsclj

(wrap-json-params
  handler
  &
  {:keys [predicate decoder charset]
   :or {predicate json-request? decoder json-parse-string charset get-charset}})

Handles body params in JSON format. See wrap-format-params for details.

Handles body params in JSON format. See wrap-format-params for details.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close