This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-22
Channels
- # beginners (55)
- # cider (22)
- # cljs-dev (123)
- # cljsrn (75)
- # clojars (1)
- # clojure (92)
- # clojure-europe (2)
- # clojure-italy (16)
- # clojure-nl (6)
- # clojure-spec (17)
- # clojure-uk (77)
- # clojured (2)
- # clojurescript (39)
- # core-async (8)
- # cursive (4)
- # data-science (1)
- # datomic (22)
- # duct (4)
- # editors (21)
- # emacs (10)
- # events (4)
- # fulcro (116)
- # graphql (8)
- # immutant (3)
- # jackdaw (1)
- # juxt (3)
- # kaocha (4)
- # luminus (1)
- # mount (1)
- # nrepl (32)
- # off-topic (34)
- # other-languages (5)
- # pedestal (32)
- # reagent (1)
- # ring (6)
- # ring-swagger (7)
- # shadow-cljs (5)
- # spacemacs (3)
- # specter (1)
- # sql (1)
- # vim (21)
Hi guys, quick question. Is there any with ring/compojure to read the raw body of a request that is application/x-www-form-urlencoded
No matter what I do, even when I remove all middleware it's always a map
I need the raw request to do a an hmac digest on it to verify the request
I thought about using (ring.util.codec/url-encode payload)
but obviously these maps aren't ordered
@mdrago1026 I'm pretty sure the answer is "no" because by the time Ring has passed you the request, it has already been read and decoded -- and not all servers allow the raw body of a request to be read twice, as I recall...
Yeah, i believe you are right, which is unfortunate. Still digging in to it. It's weird, even if I intercept the BytesInputStream
and slurp it, it already seems to be a map
For what it's worth, I found a workaround. I'm using http-kit. Before I hand the request off to any of my compojure handlers, I'm consuming the :body of the request. At this point it is still in the "raw" form. I just assoc it to the request as a different key, then pass on to the handlers. Not pretty, but it works