0

如何模拟对参数化解放者资源的请求?这是我的代码:

(defresource lookup [id]
  :available-media-types  ["application/json"]
  :allowed-methods        [:get]
  :handle-ok              #(lookup-event id))

(event/lookup (ring.mock.request/request :get "/event/1" ))

我只是得到一个函数而不是响应。你能告诉我我在这里做错了什么吗?

4

1 回答 1

2

事实证明这是正确的方法。

((event/lookup 1) (ring.mock.request/request :get "/event/1" ))
于 2016-03-09T22:28:30.333 回答