Search in sources :

Example 1 with UnboundedQueueFeedableBodyGenerator

use of org.asynchttpclient.request.body.generator.UnboundedQueueFeedableBodyGenerator in project async-http-client by AsyncHttpClient.

the class ChunkingTest method doTestWithFeedableBodyGenerator.

public void doTestWithFeedableBodyGenerator(InputStream is) throws Throwable {
    try (AsyncHttpClient c = asyncHttpClient(httpClientBuilder())) {
        final FeedableBodyGenerator feedableBodyGenerator = new UnboundedQueueFeedableBodyGenerator();
        Request r = post(getTargetUrl()).setBody(feedableBodyGenerator).build();
        ListenableFuture<Response> responseFuture = c.executeRequest(r);
        feed(feedableBodyGenerator, is);
        waitForAndAssertResponse(responseFuture);
    }
}
Also used : UnboundedQueueFeedableBodyGenerator(org.asynchttpclient.request.body.generator.UnboundedQueueFeedableBodyGenerator) Response(org.asynchttpclient.Response) FeedableBodyGenerator(org.asynchttpclient.request.body.generator.FeedableBodyGenerator) UnboundedQueueFeedableBodyGenerator(org.asynchttpclient.request.body.generator.UnboundedQueueFeedableBodyGenerator) Request(org.asynchttpclient.Request) AsyncHttpClient(org.asynchttpclient.AsyncHttpClient)

Aggregations

AsyncHttpClient (org.asynchttpclient.AsyncHttpClient)1 Request (org.asynchttpclient.Request)1 Response (org.asynchttpclient.Response)1 FeedableBodyGenerator (org.asynchttpclient.request.body.generator.FeedableBodyGenerator)1 UnboundedQueueFeedableBodyGenerator (org.asynchttpclient.request.body.generator.UnboundedQueueFeedableBodyGenerator)1