如何在liberator中模拟请求参数化资源?

时间:2016-03-09 22:14:19

标签: clojure liberator

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

(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" ))

我只是回来而不是回复。你能告诉我这里我做错了什么吗?

1 个答案:

答案 0 :(得分:1)

原来这是正确的做法。

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