Skip to content

Instantly share code, notes, and snippets.

@charles-dyfis-net
Last active December 26, 2015 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save charles-dyfis-net/6e7362a50e043ae7b327 to your computer and use it in GitHub Desktop.
Save charles-dyfis-net/6e7362a50e043ae7b327 to your computer and use it in GitHub Desktop.
(use 'compojure.core)
(require '[compojure.handler :as handler])
(require '[compojure.route :as route])
(def my-request
{:request-method :post
:uri "/lists/5/items"
:headers []
:body "hello world"
:params {:x "foo" :y "bar" :z "baz" :w "qux"}})
(defroutes my-destructuring-route
(POST "/lists/:id/items" [id :as {body :body}] (str "body was: " body "; with id: " id)))
(my-destructuring-route my-request)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment