public class AsyncCouchbaseHttpClient extends Object
Get an instance by calling Cluster.httpClient()
.
CouchbaseHttpClient
,
ReactiveCouchbaseHttpClient
Constructor and Description |
---|
AsyncCouchbaseHttpClient(AsyncCluster cluster) |
Modifier and Type | Method and Description |
---|---|
CompletableFuture<HttpResponse> |
delete(HttpTarget target,
HttpPath path)
Issues a DELETE request with default options.
|
CompletableFuture<HttpResponse> |
delete(HttpTarget target,
HttpPath path,
HttpDeleteOptions options)
Issues a DELETE request with given options.
|
CompletableFuture<HttpResponse> |
get(HttpTarget target,
HttpPath path)
Issues a GET request with default options (no query parameters).
|
CompletableFuture<HttpResponse> |
get(HttpTarget target,
HttpPath path,
HttpGetOptions options)
Issues a GET request with the given options.
|
CompletableFuture<HttpResponse> |
post(HttpTarget target,
HttpPath path)
Issues a POST request with no body and default options.
|
CompletableFuture<HttpResponse> |
post(HttpTarget target,
HttpPath path,
HttpPostOptions options)
Issues a POST request with the given options.
|
CompletableFuture<HttpResponse> |
put(HttpTarget target,
HttpPath path)
Issues a PUT request with no body and default options.
|
CompletableFuture<HttpResponse> |
put(HttpTarget target,
HttpPath path,
HttpPutOptions options)
Issues a PUT request with the given options.
|
@Stability.Internal public AsyncCouchbaseHttpClient(AsyncCluster cluster)
public CompletableFuture<HttpResponse> get(HttpTarget target, HttpPath path)
To specify query parameters, use the overload that takes HttpGetOptions
or include the query string in the path.
public CompletableFuture<HttpResponse> get(HttpTarget target, HttpPath path, HttpGetOptions options)
Specify query parameters via the options:
httpClient.get(target, path, HttpGetOptions.httpGetOptions() .queryString(Map.of("foo", "bar")));
public CompletableFuture<HttpResponse> post(HttpTarget target, HttpPath path)
To specify a request body, use the overload that takes HttpPostOptions
.
public CompletableFuture<HttpResponse> post(HttpTarget target, HttpPath path, HttpPostOptions 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("{}")));
public CompletableFuture<HttpResponse> put(HttpTarget target, HttpPath path)
To specify a request body, use the overload that takes HttpPutOptions
.
public CompletableFuture<HttpResponse> put(HttpTarget target, HttpPath path, HttpPutOptions 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("{}")));
public CompletableFuture<HttpResponse> delete(HttpTarget target, HttpPath path)
public CompletableFuture<HttpResponse> delete(HttpTarget target, HttpPath path, HttpDeleteOptions options)
Copyright © 2024 Couchbase, Inc.. All rights reserved.