Top Description Methods
org.apache.hc.client5.http.async

public Interface HttpAsyncClient

Known Direct Implementers
org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient
Imports
java.util.concurrent.Future, org.apache.hc.core5.concurrent.FutureCallback, org.apache.hc.core5.http.nio.AsyncPushConsumer, .AsyncRequestProducer, .AsyncResponseConsumer, .HandlerFactory, org.apache.hc.core5.http.protocol.HttpContext

This interface represents only the most basic contract for HTTP request execution. It imposes no restrictions or particular details on the request execution process and leaves the specifics of state management, authentication and redirect handling up to individual implementations.
Since
4.0

Method Summary

Modifier and TypeMethod and Description
public <
the result type of request execution.
T
>
Future<T>

Returns:

future representing pending completion of the operation.
execute
(AsyncRequestProducer
request producer callback.
requestProducer
,
AsyncResponseConsumer<T>
response consumer callback.
responseConsumer
,
HandlerFactory<AsyncPushConsumer>
the push handler factory. Optional and may be null.
pushHandlerFactory
,
HttpContext
HTTP context. Optional and may be null.
context
,
FutureCallback<T>
future callback. Optional and may be null.
callback
)

Initiates asynchronous HTTP request execution using the given context.

Method Detail

executeback to summary
public <T> Future<T> execute(AsyncRequestProducer requestProducer, AsyncResponseConsumer<T> responseConsumer, HandlerFactory<AsyncPushConsumer> pushHandlerFactory, HttpContext context, FutureCallback<T> callback)

Initiates asynchronous HTTP request execution using the given context.

The request producer passed to this method will be used to generate a request message and stream out its content without buffering it in memory. The response consumer passed to this method will be used to process a response message without buffering its content in memory.

Please note it may be unsafe to interact with the context instance while the request is still being executed.

Parameters
<T>
the result type of request execution.
requestProducer:AsyncRequestProducer

request producer callback.

responseConsumer:AsyncResponseConsumer<T>

response consumer callback.

pushHandlerFactory:HandlerFactory<AsyncPushConsumer>

the push handler factory. Optional and may be null.

context:HttpContext

HTTP context. Optional and may be null.

callback:FutureCallback<T>

future callback. Optional and may be null.

Returns:Future<T>

future representing pending completion of the operation.