This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-04
Channels
- # beginners (8)
- # boot (20)
- # cider (8)
- # cljs-dev (263)
- # cljsjs (8)
- # cljsrn (20)
- # clojure (151)
- # clojure-argentina (1)
- # clojure-belgium (7)
- # clojure-dev (18)
- # clojure-italy (25)
- # clojure-spec (34)
- # clojure-uk (15)
- # clojurescript (89)
- # component (45)
- # core-async (27)
- # cursive (16)
- # datomic (53)
- # emacs (40)
- # figwheel (3)
- # hoplon (62)
- # jobs (1)
- # jobs-discuss (7)
- # luminus (8)
- # lumo (60)
- # off-topic (3)
- # parinfer (1)
- # precept (1)
- # protorepl (15)
- # re-frame (37)
- # reagent (7)
- # ring (3)
- # ring-swagger (73)
- # slack-help (1)
- # specter (19)
- # sql (4)
- # test-check (10)
- # uncomplicate (2)
- # unrepl (14)
- # untangled (52)
- # vim (5)
- # yada (42)
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}))))
Thanks a lot for help
basically the question is how to handle multiple content types in one Ring application