Hi.
I am following the luminus example tutorial trying to post response from body-params. but I get no response using the following code:
(defn test4 [request]
(response/ok (str "arg1: " (:path-params request)
(str "arg2: " (:params request)
(str "arg3: " (:body-params request))))))
(defn home-routes []
[ ""
{:middleware [middleware/wrap-formats]}
["/" {:get home-page}]
["/t1" {:get (fn [request] {:status 200 :body (keys request)})}]
["/about" {:get about-page}]
["/test" test-page]
["/test2/:id" test2]
["/test3/:arg1/:arg2/:arg3" {:post test3}]
["/test4/:arg" {:post test4}]
["/echo/:id" {:get (fn [{{:keys [id]} :path-params}]
(response/ok (str "<p>value: " id "</p>")))}]
["/foo/:bar" {:post (fn [{:keys [path-params query-params body-params]}]
{:status 200
:body (str "path params: " path-params
"\nquery params: " query-params
"\nbody params: " body-params)})}]
])
I am calling curl:
curl --header "Content Type: application/json" --request POST --data '{"username":"xyz","password":"xyz"}' 'localhost:3000/test4/arg?arg=bar'
but no response on the data request. any ideas?