是否在cloudant java客户端中支持列表功能?

时间:2016-01-22 03:54:18

标签: java cloudant

1 个答案:

答案 0 :(得分:1)

没有特定的API调用可以与java-cloudant 2.2.0中的_list端点进行交互。

但是,可以手动设置请求,因此您可以尝试以下方法:

    // Compose the URI and create a HttpConnection to GET it

    URI listRequestURI = new URI(db.getDBUri().toString() 
                                 + "/_design/your-designdoc/_list/your-list/your-view");

    HttpConnection listRequest = Http.GET(listRequestURI);

    // Execute the request and get the response

    HttpConnection listResponse = account.executeRequest(listRequest);

    // Get the response in the desired format and process
    listResponse.responseAsString();
    // or responseAsBytes()
    // or responseAsInputStream()