Ring middleware that negotiates each request before the handler gets it.
Ring middleware that negotiates each request before the handler gets it.
(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:
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.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |