HTTP异步客户端HttpAsyncClient

  • 接口
/**
 * 此接口只代表HTTP请求执行的最基本的契约。它对请求执行过程不施
 * 加任何限制或特定细节,并将状态管理、身份验证和重定向处理的细节
 * 留给子类实现。
 */
public interface HttpAsyncClient {

    /**
     * 使用给定上下文启动异步HTTP请求execution。
     */
    <T> Future<T> execute(
            HttpAsyncRequestProducer requestProducer,
            HttpAsyncResponseConsumer<T> responseConsumer,
            HttpContext context,
            FutureCallback<T> callback);

    /**
     * 使用默认上下文启动异步HTTP请求execution
     */
    <T> Future<T> execute(
            HttpAsyncRequestProducer requestProducer,
            HttpAsyncResponseConsumer<T> responseConsumer,
            FutureCallback<T> callback);

    /**
     * 启动给定目标的异步HTTP请求execution(指定上线文)
     */
    Future<HttpResponse> execute(
            HttpHost target, HttpRequest request, HttpContext context,
            FutureCallback<HttpResponse> callback);

    /**
     * 启动给定目标的异步HTTP请求execution
     */
    Future<HttpResponse> execute(
            HttpHost target, HttpRequest request,
            FutureCallback<HttpResponse> callback);

    /**
     * 使用给定上下文启动异步HTTP请求execution
     */
    Future<HttpResponse> execute(
            HttpUriRequest request, HttpContext context,
            FutureCallback<HttpResponse> callback);

    /**
     * 启动异步HTTP请求execution
     */
    Future<HttpResponse> execute(
            HttpUriRequest request,
            FutureCallback<HttpResponse> callback);

}

  • ** 实现类 **


    MinimalHttpAsyncClient继承关系图.png
MinimalHttpAsyncClient继承关系图.png
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容