org.apache.http.NoHttpResponseException: XX.XX.XX.XX:80 failed to respond

解决:

Finally I fix the issue and it is caused by buffer size. By default, buffer size of httpclient is 8k. So I change it to 4k and my code works well.

Here is the code that changes buffer size:

 ConnectionConfig connectionConfig = ConnectionConfig.custom()
                .setBufferSize(4128)
                .build();

 CloseableHttpClient httpclient = HttpClients.custom()
                .setDefaultConnectionConfig(connectionConfig)
                .build();

原贴:https://stackoverflow.com/questions/26111331/org-apache-http-nohttpresponseexception-xx-xx-xx-xx443-failed-to-respond
posted @ 2018-06-25 17:00  jwcc  阅读(3328)  评论(0编辑  收藏  举报