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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM