Liking cljdoc? Tell your friends :D
All platforms.

dk.simongray.conneg.ring

Ring middleware that negotiates each request before the handler gets it.

Ring middleware that negotiates each request before the handler gets
it.
raw docstring

wrap-negotiateclj/s

(wrap-negotiate handler negotiation)
(wrap-negotiate handler negotiation opts)

Ring middleware that negotiates each request by the negotiation before the handler gets it, with the opts below.

The handler finds the decision of conneg/negotiate in the request, under :dk.simongray.conneg/decision. When nothing is acceptable, the middleware answers 406 itself. It adds the fields that the decision looked at to the Vary header of every response.

The opts are:

  • :not-acceptable, a function of the request and the decision that returns the response when nothing is acceptable, e.g. a 406 of your own. By default it's conneg/not-acceptable with the alternates of the request.
  • :link?, to add a Link to each other representation to a successful response to GET or HEAD, with rel="alternate"
  • :content-location?, to add the URL of the chosen representation to a successful response to GET or HEAD, when a query parameter or the :href of the negotiation pins down each dimension

It takes a synchronous or an asynchronous handler.

Ring middleware that negotiates each request by the `negotiation` before
the `handler` gets it, with the `opts` below.

The handler finds the decision of conneg/negotiate in the request, under
:dk.simongray.conneg/decision. When nothing is acceptable, the
middleware answers 406 itself. It adds the fields that the decision
looked at to the Vary header of every response.

The `opts` are:

- :not-acceptable, a function of the request and the decision that
  returns the response when nothing is acceptable, e.g. a 406 of your
  own. By default it's conneg/not-acceptable with the alternates of the
  request.
- :link?, to add a Link to each other representation to a successful
  response to GET or HEAD, with rel="alternate"
- :content-location?, to add the URL of the chosen representation to a
  successful response to GET or HEAD, when a query parameter or the
  :href of the negotiation pins down each dimension

It takes a synchronous or an asynchronous handler.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close