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é
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
body()
Map<String,Object>
headers()
HttpMethod
method()
String
path()
String
pathWithParameters()
Map<String,String>
queryParameters()
-
Methods inherited from class com.couchbase.client.core.message.AbstractCouchbaseRequest
afterSpanSet, bucket, complete, creationTime, dispatchHostname, dispatchHostname, emit, fail, incrementRetryCount, isActive, lastLocalId, lastLocalId, lastLocalSocket, lastLocalSocket, lastRemoteSocket, lastRemoteSocket, maxRetryDuration, maxRetryDuration, observable, operationId, password, retryAfter, retryAfter, retryCount, retryDelay, retryDelay, span, span, subscriber, succeed, toString, username
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.couchbase.client.core.message.CouchbaseMessage
creationTime
-
Methods inherited from interface com.couchbase.client.core.message.CouchbaseRequest
bucket, complete, dispatchHostname, dispatchHostname, emit, fail, incrementRetryCount, isActive, lastLocalId, lastLocalId, lastLocalSocket, lastLocalSocket, lastRemoteSocket, lastRemoteSocket, maxRetryDuration, maxRetryDuration, observable, operationId, password, retryAfter, retryAfter, retryCount, retryDelay, retryDelay, span, span, subscriber, succeed, username
-
-
-
-
Constructor Detail
-
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
- theHttpMethod
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 Detail
-
path
public String path()
- Specified by:
path
in interfaceConfigRequest
-
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.
-
pathWithParameters
public String pathWithParameters()
- Returns:
- the full path, with query parameters added at the end.
-
-