Fork me on GitHub
#ring
<
2017-07-04
>
petr.mensik14:07:19

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.mensik14:07:58

Thanks a lot for help

petr.mensik19:07:29

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