Hey guys, Anyone have an easy way to send multipart/form-data requests with ring-mock? I'm having a heck of a time trying to post a file.
My ring handler returns this response {:status 400, :headers {}, :body "Bad request."}
(after middleware), however my browser receives a 404 with no body when I send a request.
What might the reason for that be? I have no routing installed, and no part in my code creates a 404 response.
(defn wrap-log [handler]
(fn [req]
(println "-----REQUEST-----")
(pprint req)
(println "-----RESPONSE-----")
(pprint (handler req))))
(def app
(-> handler
wrap-json-response
wrap-clean-json
wrap-json-body
(wrap-authenticate (:public-key config))
wrap-log))
(defn -main [& args]
(mount/start)
(http-server/run-server app))
This is an excerpt from my main namespace. I got the information about the response from the wrap-log middleware. The server is http-kit.pprint is returning nil
wrap-log needs to actually return the result of the call to handler
Yep, I just found it too... Sometimes such obvious errors manage to escape your sight
Thank you