I am writing a web application using Ring and Compojure and the Friend library for authorization. I recently made some changes to the project, and now I can no longer request query parameters.
What I did was:
; Routes definition
(defroutes app-routes
(POST "/*.do" request
(insert-data (:params request))))
; Middlewares
(def secured-routes
(handler/site
(-> app-routes
wrap-params
(friend/authenticate friend-params-map))))
Parametersand the form / URL will be parsed onto a Clojure map. Now it does not work, and (:params request)contains form cards
{:* <request-url>}
using one key :*. If I try (println request), get a Clojure card with a lot of key-value pairs, among which are
:body #object[org.eclipse.jetty.server.HttpInputOverHTTP 0x6ef9a9e1 HttpInputOverHTTP@6ef9a9e1]
which seem to contain request data, right? But how do I get them?
I used to just use middleware wrap-paramsas described above and it worked.
, , (body-string request) , . Clojure URL. , - .
- ? , , , wrap-params .
!
: @nberger, secured-routes :
(def secured-routes
(-> app-routes
(wrap-defaults site-defaults)
(friend/authenticate friend-params-map)))
( ). wrap-defaults friend/authenticate, , - (???)