我正在对我的 luminus 应用程序进行测试,我想测试我的后期功能,如下所示。但是,数据作为字节输入流发布在请求对象的主体上。如何使数据发布在请求对象的 params 键上?我从这个链接http://www.jarrodctaylor.com/posts/Compojure-Address-Book-Part-1/得到了这个例子
(defn example-post [request]
(let [post-value (get-in request [:params :example-post])]
(str "You posted: " post-value)))
(fact "Test POST"
(let [response (app (mock/request :post "/post" {:example-post "Some data"}))]
(:status response) => 200
(:body response) => "You posted: Some data")))