Fork me on GitHub

Hi. I'm wondering if it's possible to have both GET and POST for the same route with reitit? When I try the following I get an error


Sure, you just have to nest it instead of listing it as a series of empty routes:

  {:middleware [middleware/wrap-csrf middleware/wrap-formats]
   :name "Polls"
   :get {:handler #'my/get-handler}
   :post {:handler #'my/post-handler}}
Caveat: that’s my early morning, pre-coffee, top-of-my-head code, I think it’s correct but no guarantees. That’s the general idea tho.


Ah now I see, thanks! I tried something earlier but it didn't work. But this worked