(->method request & clauses)
Like clojure.core/case except that the first argument must be a request map. Odd numbered clauses imply the last argument is the default expression invoked on no-match. Even numbered clauses return HTTP 405 (method not supported) by default on no-match. The dispatch happens in constant time.
Like clojure.core/case except that the first argument must be a request map. Odd numbered clauses imply the last argument is the default expression invoked on no-match. Even numbered clauses return HTTP 405 (method not supported) by default on no-match. The dispatch happens in constant time.
(->uri request & clauses)
Given a ring request map and pairs of URI-templates (e.g. '/user/:id/profile/:type/') and expression clauses, evaluate matching expression after adding URI params as a map to the :params key in the request map. Odd numbered clauses imply the last argument is the default expression invoked on no-match. Even numbered clauses return HTTP 400 by default on no-match. The dispatch happens in linear time based on URI length and number of clauses.
Given a ring request map and pairs of URI-templates (e.g. '/user/:id/profile/:type/') and expression clauses, evaluate matching expression after adding URI params as a map to the :params key in the request map. Odd numbered clauses imply the last argument is the default expression invoked on no-match. Even numbered clauses return HTTP 400 by default on no-match. The dispatch happens in linear time based on URI length and number of clauses.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close