Search in sources :

Example 6 with RequestBuilder

use of org.asynchttpclient.RequestBuilder in project async-http-client by AsyncHttpClient.

the class SimpleAsyncHttpClient method post.

public Future<Response> post(BodyGenerator bodyGenerator, BodyConsumer bodyConsumer) throws IOException {
    RequestBuilder r = rebuildRequest(requestBuilder.build());
    r.setMethod("POST");
    r.setBody(bodyGenerator);
    return execute(r, bodyConsumer, null);
}
Also used : RequestBuilder(org.asynchttpclient.RequestBuilder)

Example 7 with RequestBuilder

use of org.asynchttpclient.RequestBuilder in project async-http-client by AsyncHttpClient.

the class SimpleAsyncHttpClient method head.

public Future<Response> head(ThrowableHandler throwableHandler) throws IOException {
    RequestBuilder r = rebuildRequest(requestBuilder.build());
    r.setMethod("HEAD");
    return execute(r, null, throwableHandler);
}
Also used : RequestBuilder(org.asynchttpclient.RequestBuilder)

Example 8 with RequestBuilder

use of org.asynchttpclient.RequestBuilder in project async-http-client by AsyncHttpClient.

the class SimpleAsyncHttpClient method put.

public Future<Response> put(BodyGenerator bodyGenerator) throws IOException {
    RequestBuilder r = rebuildRequest(requestBuilder.build());
    r.setMethod("PUT");
    r.setBody(bodyGenerator);
    return execute(r, null, null);
}
Also used : RequestBuilder(org.asynchttpclient.RequestBuilder)

Example 9 with RequestBuilder

use of org.asynchttpclient.RequestBuilder in project async-http-client by AsyncHttpClient.

the class SimpleAsyncHttpClient method options.

public Future<Response> options(BodyConsumer bodyConsumer, ThrowableHandler throwableHandler) throws IOException {
    RequestBuilder r = rebuildRequest(requestBuilder.build());
    r.setMethod("OPTIONS");
    return execute(r, bodyConsumer, throwableHandler);
}
Also used : RequestBuilder(org.asynchttpclient.RequestBuilder)

Example 10 with RequestBuilder

use of org.asynchttpclient.RequestBuilder in project async-http-client by AsyncHttpClient.

the class SimpleAsyncHttpClient method delete.

public Future<Response> delete(BodyConsumer bodyConsumer, ThrowableHandler throwableHandler) throws IOException {
    RequestBuilder r = rebuildRequest(requestBuilder.build());
    r.setMethod("DELETE");
    return execute(r, bodyConsumer, throwableHandler);
}
Also used : RequestBuilder(org.asynchttpclient.RequestBuilder)

Aggregations

RequestBuilder (org.asynchttpclient.RequestBuilder)44 Request (org.asynchttpclient.Request)18 AsyncHttpClient (org.asynchttpclient.AsyncHttpClient)17 Test (org.testng.annotations.Test)17 Response (org.asynchttpclient.Response)14 AbstractBasicTest (org.asynchttpclient.AbstractBasicTest)9 Realm (org.asynchttpclient.Realm)4 SpnegoEngineException (org.asynchttpclient.spnego.SpnegoEngineException)4 HttpHeaders (io.netty.handler.codec.http.HttpHeaders)3 Uri (org.asynchttpclient.uri.Uri)3 DefaultHttpHeaders (io.netty.handler.codec.http.DefaultHttpHeaders)2 HttpRequest (io.netty.handler.codec.http.HttpRequest)2 UUID (java.util.UUID)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 Consumer (java.util.function.Consumer)2 Slf4j (lombok.extern.slf4j.Slf4j)2 lombok.val (lombok.val)2 Request (okhttp3.Request)2 Response (okhttp3.Response)2 REQUEST (org.asynchttpclient.extras.retrofit.AsyncHttpClientCallTest.REQUEST)2