Neeraj Krishna
Neeraj Krishna

Reputation: 1615

Is the lists function supported in cloudant java client?

In the cloudant java client (http://www.javadoc.io/doc/com.cloudant/cloudant-client/2.2.0) is this lists function described here supported?

https://cloudant.com/blog/building-custom-dashboards-with-geckoboard-and-cloudant

Upvotes: 0

Views: 116

Answers (1)

ricellis
ricellis

Reputation: 396

There are no specific API calls to interact with the _list endpoint in java-cloudant 2.2.0.

However, it is possible to manually set up a request, so you could try something like:

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

Upvotes: 1

Related Questions