use of org.asynchttpclient.RequestBuilder in project async-http-client by AsyncHttpClient.
the class SimpleAsyncHttpClient method delete.
public Future<Response> delete(ThrowableHandler throwableHandler) throws IOException {
RequestBuilder r = rebuildRequest(requestBuilder.build());
r.setMethod("DELETE");
return execute(r, null, throwableHandler);
}
use of org.asynchttpclient.RequestBuilder in project async-http-client by AsyncHttpClient.
the class SimpleAsyncHttpClient method delete.
public Future<Response> delete(BodyConsumer bodyConsumer) throws IOException {
RequestBuilder r = rebuildRequest(requestBuilder.build());
r.setMethod("DELETE");
return execute(r, bodyConsumer, null);
}
use of org.asynchttpclient.RequestBuilder in project async-http-client by AsyncHttpClient.
the class SimpleAsyncHttpClient method post.
public Future<Response> post(BodyGenerator bodyGenerator, ThrowableHandler throwableHandler) throws IOException {
RequestBuilder r = rebuildRequest(requestBuilder.build());
r.setMethod("POST");
r.setBody(bodyGenerator);
return execute(r, null, throwableHandler);
}
use of org.asynchttpclient.RequestBuilder in project async-http-client by AsyncHttpClient.
the class SimpleAsyncHttpClient method options.
public Future<Response> options(ThrowableHandler throwableHandler) throws IOException {
RequestBuilder r = rebuildRequest(requestBuilder.build());
r.setMethod("OPTIONS");
return execute(r, null, throwableHandler);
}
use of org.asynchttpclient.RequestBuilder in project async-http-client by AsyncHttpClient.
the class ConnectionPoolTest method nonPoolableConnectionReleaseSemaphoresTest.
@Test(groups = "standalone")
public void nonPoolableConnectionReleaseSemaphoresTest() throws Throwable {
RequestBuilder request = get(getTargetUrl()).setHeader("Connection", "close");
try (AsyncHttpClient client = asyncHttpClient(config().setMaxConnections(6).setMaxConnectionsPerHost(3))) {
client.executeRequest(request).get();
Thread.sleep(1000);
client.executeRequest(request).get();
Thread.sleep(1000);
client.executeRequest(request).get();
Thread.sleep(1000);
client.executeRequest(request).get();
}
}
Aggregations