Class RestApiRequest

java.lang.Object
com.couchbase.client.core.message.AbstractCouchbaseRequest
com.couchbase.client.core.message.config.RestApiRequest
All Implemented Interfaces:
BootstrapMessage, ConfigRequest, CouchbaseMessage, CouchbaseRequest

public class RestApiRequest
extends AbstractCouchbaseRequest
implements ConfigRequest
A generic HTTP request to perform on the cluster REST API port (8091).
Since:
1.3.2
Author:
Simon Baslé
  • Constructor Details

    • RestApiRequest

      public RestApiRequest​(String login, String password, HttpMethod method, String path, Map<String,​String> queryParameters, Map<String,​Object> headers, String body)
      Create a new API request.
      Parameters:
      login - the authentication login to use.
      password - the authentication password to use.
      method - the HttpMethod for the request.
      path - the path of the request.
      queryParameters - the query parameters to append to the url (key/values must be urlencoded).
      headers - the headers for the request.
      body - the body of the request (or empty string if not required).
  • Method Details

    • path

      public String path()
      Specified by:
      path in interface ConfigRequest
    • method

      public HttpMethod method()
      Returns:
      the HttpMethod to use for the request.
    • body

      public String body()
      Returns:
      the body of the request (empty string if none).
    • queryParameters

      public Map<String,​String> queryParameters()
      Returns:
      the request's url query parameters, as a Map.
    • headers

      public Map<String,​Object> headers()
      Returns:
      the request headers, as a Map.
    • pathWithParameters

      public String pathWithParameters()
      Returns:
      the full path, with query parameters added at the end.