Destructuring parameters - oliyh/learning-clojure GitHub Wiki

Compojure allows "destructuring" of urls and parameters in the same way as one can do with function declarations. Some examples from Cljockwork follow:

(GET "/tasks/:id" [id] (api/view-task id))
(PUT "/tasks/add" {body :body} (api/schedule-task body))

By using appropriate middleware the content of body can be turned into a Clojure data structure with no further code.