Closed vinurs closed 2 years ago
i use
lein new luminus app +undertow +postgres +swagger +auth +auth-jwe
create a service, and add the code below
["/test-xml" {:post {:swagger {:consumes ["application/xml"]} :summary "test xml" :parameters {:body any?} :responses {200 {:body any?}} :handler (fn [{{{:keys [] :as body} :body {:keys [] :as query} :query :as parameters} :parameters {:keys [] :as headers} :headers {:keys [] :as identity} :identity :as all}] (log/info body) )}}]
then, send a request like this
but the (log/info body) is nil
(log/info body)
https://clojurians.slack.com/archives/C7YF1SBT3/p1591340938060100
we can use (slurp (:body request)) to get the body and parse it using xml lib
(slurp (:body request))
i use
create a service, and add the code below
then, send a request like this
but the
(log/info body)
is nil