This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-22
Channels
- # beginners (124)
- # boot (7)
- # cider (73)
- # cljs-dev (37)
- # cljsrn (6)
- # clojure (85)
- # clojure-greece (4)
- # clojure-italy (67)
- # clojure-nl (6)
- # clojure-russia (4)
- # clojure-spec (6)
- # clojure-uk (48)
- # clojurescript (26)
- # cursive (5)
- # data-science (23)
- # datomic (63)
- # editors (5)
- # emacs (4)
- # graphql (13)
- # immutant (2)
- # lumo (4)
- # mount (3)
- # off-topic (1)
- # onyx (4)
- # pedestal (7)
- # portkey (10)
- # re-frame (14)
- # reagent (10)
- # ring-swagger (18)
- # shadow-cljs (97)
- # spacemacs (1)
- # tools-deps (9)
- # vim (1)
- # yada (13)
yes I was worried about the order. I’ll double check my code, you are right about the sig vs secret
When I do (String. ba)
I get “POST /gh-hook HTT” -> doesn’t look like I have the body in that buffer
So I guess the question is still, how do I get bytes or the string representing the body in yada?
ah I was looking at the wrong multimethod it seems (`yada.body/to-body` and render-map
render-seq
).
Will have a look at yada.request-body/process-request-body
thanks 🙂
looks like this works 😄
(defmethod yada.request-body/process-request-body :raw ;; TODO better naming
[ctx body-stream media-type & args]
(let [body-string (bs/to-string body-stream)]
(assoc-in ctx [:request :body-string] body-string)))
the above consumes the [:request :body]
- not a big deal, I know it is JSON and can parse it.
It would be nice to let yada handle it the “normal”, parse it, validate it etc. Is there a way to recreate the original body-stream
or pass something that the rest of the yada interceptor chain would understand there?