最近用server酱-PushBear做消息自动推送,用apache HttpClient做https的get请求,但是代码上到服务器端就报javax.net.ssl.SSLException: Certificate for <域名> doesn't match any of the subject alternative names: [域名],仔细翻了一下文档发现是HttpClient 4.4.1版本的bug,试了很多解决方案,最后在stackoverflow上面找到了正解,链接如下:l…
在使用HttpClient发送请求,使用httpMethod.getResponseBodyAsString();时当返回值过大时会报错: org.apache.commons.httpclient.HttpMethodBase - Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended. 可以如下解决: BufferedReader…