Fork me on GitHub
#ring
<
2018-11-17
>
abdullahibra20:11:52

how can i destructing route "/users/:id" [id] how can i include full request too ?

seancorfield22:11:18

@abdullahibra I'm not I understand what you're asking there. What do mean by "include full request" in that context?

seancorfield22:11:47

If you have (GET "/users/:id" [id] handler-fn) then the handler function is still passed the whole Ring request.

abdullahibra23:11:36

[id :as request] ?

seancorfield23:11:45

(defn handler-fn [req] ...)

seancorfield23:11:55

It will be passed the Ring request hash map.

seancorfield23:11:37

(you don't actually need id in the route parameters, as I recall, so (GET "/users/:id" [] handler-fn) would also work -- but I tend to list them there for clarity of intent)