Allow use of non form-encoded payload
rukor opened this issue · 1 comments
rukor commented
At the moment, it always tries to make the request entity part of the base string irrespective of the content-type; this obviously run into issues when it tries to parse the body. So I changed parse-body-params to:
(defn parse-body-params
"Parse the body of `request` as an URL encoded parameter list."
[request]
(let [body (to-str (:body request))]
(if (and (= x-www-form-urlencoded (:content-type request))
(not (blank? body)))
(-> (apply hash-map (split body #"[=&]"))
(transform-values url-decode))
{})))
I can send a pull request if you prefer.
Thanks,
R