form-params convert to body automatically

6 views
Skip to first unread message

vinurs

unread,
Jul 2, 2018, 7:53:49 AM7/2/18
to Luminus
Hi,
   is there any way can convert form-params to body automatically?

Dmitri

unread,
Jul 3, 2018, 8:34:50 AM7/3/18
to Luminus
You could do that via middleware, e.g:

(defn wrap-form-params->body [handler]
 
(fn [req] (handler (if-let [params (:form-params req)] (assoc req :body params) req))))


Reply all
Reply to author
Forward
0 new messages