(negotiate-response-content-type acceptable-media-types)
(negotiate-response-content-type acceptable-media-types media-type-fns)
Creates an interceptor with an enter fn that negotiates content type based on an ordered sequence of acceptable-media-types, adding the best choice to the request at the key :media-type. If no acceptable content type is available, replies with a 406 Not Acceptable.
Its leave fn looks for the :media-type key on the request and a :content key on the response and encodes it into the body according to the media-type-fns map. A set of default media-type-fns is provided.
Creates an interceptor with an enter fn that negotiates content type based on an ordered sequence of acceptable-media-types, adding the best choice to the request at the key :media-type. If no acceptable content type is available, replies with a 406 Not Acceptable. Its leave fn looks for the :media-type key on the request and a :content key on the response and encodes it into the body according to the media-type-fns map. A set of default media-type-fns is provided.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close