Liking cljdoc? Tell your friends :D

macchiato.middleware.restful-format


concat-streamcljs

source

ctcljs

source

default-accept-typescljs

source

default-content-typescljs

source

deserialize-requestcljs

source

format-response-bodycljs

(format-response-body request response accept-types transit-opts raise)
source

infer-request-content-typecljs

(infer-request-content-type headers content-types)
source

infer-response-content-typecljs

(infer-response-content-type {:keys [body] :as request} accept-types)
source

lrucljs

source

parse-accept-headercljs

(parse-accept-header accept-header)
source

serialize-responsecljs

source

wrap-restful-formatcljs

(wrap-restful-format handler
                     &
                     [{:keys [content-types accept-types keywordize?
                              transit-opts]}])

attempts to infer the request content type using the content-type header serializes the response based on the first known accept header

the handler can be followed by a map of options

option keys: :content-types a set of strings matching the content types :accept-types a set of strings mactching accept types, ressolves in client preferred order :keywordize? a boolean specifying whether to keywordize the parsed JSON request body :transit-opts a map containing transit configuration options of the form {:reader {:type ... :opts ...} :writer {:type ... :opts ...} where :type and :opts are exactly as defined in the transit spec

attempts to infer the request content type using the content-type header
serializes the response based on the first known accept header

the handler can be followed by a map of options

option keys:
:content-types a set of strings matching the content types
:accept-types a set of strings mactching accept types, ressolves in client preferred order
:keywordize? a boolean specifying whether to keywordize the parsed JSON request body
:transit-opts a map containing transit configuration options of the form
  {:reader {:type ... :opts ...}
   :writer {:type ... :opts ...}
  where :type and :opts are exactly as defined in the transit spec
sourceraw docstring

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

× close