CloseableHttpClient read time out
public static String httpGetRequest(String url) {
   HttpGet httpGet = new HttpGet(url);
  //加入超时设置
   RequestConfig requestConfig  = RequestConfig.custom()
         .setSocketTimeout(5000)
         .setConnectTimeout(5000)
         .setConnectionRequestTimeout(5000)
         .setStaleConnectionCheckEnabled(true)
         .build();
   httpGet.setConfig(requestConfig);
}
阅读更多
文章标签: httpclient超时
个人分类: web java
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

CloseableHttpClient read time out

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭