Package com.couchbase.client.java.http
Class AsyncCouchbaseHttpClient
java.lang.Object
com.couchbase.client.java.http.AsyncCouchbaseHttpClient
A specialized HTTP client for making requests to Couchbase Server.
Get an instance by calling Cluster.httpClient()
.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondelete
(HttpTarget target, HttpPath path) Issues a DELETE request with default options.delete
(HttpTarget target, HttpPath path, HttpDeleteOptions options) Issues a DELETE request with given options.get
(HttpTarget target, HttpPath path) Issues a GET request with default options (no query parameters).get
(HttpTarget target, HttpPath path, HttpGetOptions options) Issues a GET request with the given options.post
(HttpTarget target, HttpPath path) Issues a POST request with no body and default options.post
(HttpTarget target, HttpPath path, HttpPostOptions options) Issues a POST request with the given options.put
(HttpTarget target, HttpPath path) Issues a PUT request with no body and default options.put
(HttpTarget target, HttpPath path, HttpPutOptions options) Issues a PUT request with the given options.
-
Constructor Details
-
AsyncCouchbaseHttpClient
-
-
Method Details
-
get
Issues a GET request with default options (no query parameters).To specify query parameters, use the overload that takes
HttpGetOptions
or include the query string in the path. -
get
public CompletableFuture<HttpResponse> get(HttpTarget target, HttpPath path, HttpGetOptions options) Issues a GET request with the given options.Specify query parameters via the options:
httpClient.get(target, path, HttpGetOptions.httpGetOptions() .queryString(Map.of("foo", "bar")));
-
post
Issues a POST request with no body and default options.To specify a request body, use the overload that takes
HttpPostOptions
. -
post
public CompletableFuture<HttpResponse> post(HttpTarget target, HttpPath path, HttpPostOptions options) Issues a POST request with the given options.Specify a request body via the options:
// form data httpClient.post(target, path, HttpPostOptions.httpPostOptions() .body(HttpBody.form(Map.of("foo", "bar"))); // JSON document httpClient.post(target, path, HttpPostOptions.httpPostOptions() .body(HttpBody.json("{}")));
-
put
Issues a PUT request with no body and default options.To specify a request body, use the overload that takes
HttpPutOptions
. -
put
public CompletableFuture<HttpResponse> put(HttpTarget target, HttpPath path, HttpPutOptions options) Issues a PUT request with the given options.Specify a request body via the options:
// form data httpClient.put(target, path, HttpPostOptions.httpPutOptions() .body(HttpBody.form(Map.of("foo", "bar"))); // JSON document httpClient.put(target, path, HttpPostOptions.httpPutOptions() .body(HttpBody.json("{}")));
-
delete
Issues a DELETE request with default options. -
delete
public CompletableFuture<HttpResponse> delete(HttpTarget target, HttpPath path, HttpDeleteOptions options) Issues a DELETE request with given options.
-