HttpClients.custom的创建

/**
 * 创建httpClient
 */
CloseableHttpClient httpclient = HttpClients.custom()
                                 .setConnectionManager(connManager)             //连接管理器
                                 .setDefaultRequestConfig(defaultRequestConfig) //默认请求配置
                                 .setRetryHandler(myRetryHandler)               //重试策略
                                 .build();

 

posted @ 2020-12-21 23:48  King-DA  阅读(1361)  评论(0编辑  收藏  举报