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

猜你喜欢

转载自www.cnblogs.com/bchange/p/9225126.html
xx