title: Clojure Noir Json Put
body: <p>I'm working through the tutorial <a href="http://mmcgrana.github.com/2010/08/clojure-rest-api.html" rel="nofollow">Mark McGranaghan REST Tutorial</a> however I'm trying to do it using Noir instead.</p>
  
  <p>I can add new items, however it never takes the body of the PUT command.  </p>
  
  <p>I think the problem with how I'm trying to construct the put statement.  I'm thinking the {:keys [id attrs]} is the issue, because I'm trying to tell it the json content is in the url, when its not, its in the body.  Can anyone advise how i retrieve it from the body using noirs defpage?</p>
  
  <p>(put is in a separate elem file)</p>
  
  <pre><code>(defn put [id attrs]
    (let [new-attrs (merge (get id) attrs)]
    (swap! elems assoc id new-attrs)
    new-attrs))
  
  (defpage [:put "/elems/:id"] {:keys [id attrs]}
    (json-response (elem/put id attrs)))
  </code></pre>