ring

petr.mensik 2017-07-04T14:57:19.556795Z

I have a (hopefully) simple question. I want to use both wrap-json-params and wrap-multipart-params middleware. So far I needed just parse JSON into my request map which worked fine. Now I've added multipart route but it's not getting found by client which yields 404 error - however it's found when if I put there application/json as content type (but obviously ends up with parsing error). So how can I make Ring accept both content types? Here is my handler

(def app (middleware/app-handler
          [routes]
          :middleware [wrap-all-cors wrap-public-resource wrap-static-content-reload
                       wrap-json-params wrap-exceptions]
          :formats [:json-kw :edn]
          :ring-defaults (-> ring-defaults/site-defaults
                             (assoc :params {:multipart true}))))

petr.mensik 2017-07-04T14:57:58.570842Z

Thanks a lot for help

petr.mensik 2017-07-04T19:12:29.116539Z

basically the question is how to handle multiple content types in one Ring application