This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-18
Channels
- # announcements (1)
- # babashka (16)
- # beginners (39)
- # calva (17)
- # cider (21)
- # cljs-dev (1)
- # clojars (2)
- # clojure (39)
- # clojure-australia (1)
- # clojure-europe (1)
- # clojure-spec (7)
- # conjure (1)
- # cursive (6)
- # datomic (2)
- # depstar (5)
- # graalvm (20)
- # instaparse (11)
- # meander (4)
- # pathom (4)
- # pedestal (3)
- # polylith (18)
- # re-frame (13)
- # reagent (4)
- # reitit (3)
- # shadow-cljs (2)
- # spacemacs (14)
- # vrac (1)
hello all. using the interceptor body-params, i'm able to accept a post verb with a json body as edn as documented. Im i wrong to expect an end assoc map structure, with the Content-Type header set, should also be handled in the response by the same inteceptor (:leave) ?
(def test
{:name :test
:enter
(fn [context]
(let [request (:request context)
{:keys [headers json-params]} request]
(assoc context :response
{:status 200
:body json-params
:headers {"Content-Type" "application/json"}})))})
(def common [(body-params)])
(def test-interceptor (conj common test))
(def routes
#{["/test" :post test-interceptor :route-name :test]})
The HTTP response in the client has the Content-Type set to "application/json", but the body of the response is still edn: {:key "value"}
My assumption is that body-params on :leave will stringify-keys or such