Я использую перидот - https://github.com/xeqi/peridot, чтобы проверить мое кольцо приложения, и его работает отлично, пока я пытаюсь издеваться пост запрос с данными JSON:Как я могу высмеять запрос json post в кольце?
(require '[cheshire.core :as json]) (use 'compojure.core) (defn json-post [req] (if (:body req) (json/parse-string (slurp (:body req))))) (defroutes all-routes (POST "/test/json" req (json-response (json-post req)))) (def app (compojure.handler/site all-routes)) (use 'peridot.core) (-> (session app) (request "/test/json" :request-method :post :body (java.io.ByteArrayInputStream. (.getBytes "hello" "UTF-8")))
дает IOException: stream closed
.
Есть ли лучший способ сделать это?