如何获得Etag for Restheart系列

时间:2017-02-21 13:26:04

标签: java mongodb restheart

我正在尝试使用Restheart API删除集合。

$http DELETE 127.0.0.1:8080/testDB/testCollection

但是我收到了错误:

"The collection's ETag must be provided using the 'If-Match' header."

如果我使用GET:

http GET 127.0.0.1:8080/testDB/testCollection

我可以看到上一个GET请求响应中的etag,并手动将其添加到If-Match标头中,以便删除该集合。

但是我不明白我将如何检索给定集合的_etag(即testCollection)。

我的最终目标是使用apache http commons作为REST API客户端从java应用程序中删除该集合。因此,非常欢迎java中的示例。

0 个答案:

没有答案
相关问题