Package com.couchbase.client.java.http
Class AsyncCouchbaseHttpClient
- java.lang.Object
-
- com.couchbase.client.java.http.AsyncCouchbaseHttpClient
-
public class AsyncCouchbaseHttpClient extends Object
A specialized HTTP client for making requests to Couchbase Server.Get an instance by calling
Cluster.httpClient()
.- See Also:
CouchbaseHttpClient
,ReactiveCouchbaseHttpClient
-
-
Constructor Summary
Constructors Constructor Description AsyncCouchbaseHttpClient(AsyncCluster cluster)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Constructor Detail
-
AsyncCouchbaseHttpClient
@Internal public AsyncCouchbaseHttpClient(AsyncCluster cluster)
-
-
Method Detail
-
get
public CompletableFuture<HttpResponse> get(HttpTarget target, HttpPath path)
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
public CompletableFuture<HttpResponse> post(HttpTarget target, HttpPath path)
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
public CompletableFuture<HttpResponse> put(HttpTarget target, HttpPath path)
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
public CompletableFuture<HttpResponse> delete(HttpTarget target, HttpPath path)
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.
-
-