I am trying to get my head round clojure liberator and i have come across this type of code below:
:handle-ok (by-method {
:get (fn [ctx] (render-item (:item ctx)))
:post (fn [ctx] (render-item (:item ctx)))
:put (fn [ctx] (update-item-response coll-slug ctx))})
At first I thought that handle-ok
was simply for GET requests but then I came across this.
Why would I provide handlers for post and put in the example above? Are these post-request handlers.