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