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 Summary
-
Method Summary
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 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
- 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 Details
-
path
- Specified by:
path
in interfaceConfigRequest
-
method
- Returns:
- the
HttpMethod
to use for the request.
-
body
- Returns:
- the body of the request (empty string if none).
-
queryParameters
- Returns:
- the request's url query parameters, as a Map.
-
headers
- Returns:
- the request headers, as a Map.
-
pathWithParameters
- Returns:
- the full path, with query parameters added at the end.
-