io.pedestal.http.content-negotiation

best-match

(best-match match-fn parsed-accept-maps)

best-match-fn

(best-match-fn supported-type-strs)

negotiate-content

(negotiate-content supported-type-strs)(negotiate-content supported-type-strs opts-map)

Given a vector of strings (supported types mime-types) and optionally a map of additional options, return an interceptor that will parse client-request response formats, and add an :accept key on the request, of the most acceptable response format.

The format of the :accept value is a map containing :field, :type, and :subtype - all strings

Additional options: :no-match-fn - A function that takes a context; Called when no acceptable format/mime-type is found :content-param-paths - a vector of vectors; paths into the context to find ‘accept’ format strings

parse-accept-*

(parse-accept-* accept-str)

parse-accept-element

(parse-accept-element accept-elem-str)

weighted-accept-qs

(weighted-accept-qs supported-types accept-elem)