今天碰到个很奇怪的问题,APP通过代理链接服务器会收到HTTP 417错误,经过网上查找发现是由于以下代码造成:

HttpParams params = new BasicHttpParams();
HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
HttpProtocolParams.setContentCharset(params, HTTP.DEFAULT_CONTENT_CHARSET);
HttpProtocolParams.setUseExpectContinue(params, true);
HttpConnectionParams.setConnectionTimeout(params, CONNECTION_TIMEOUT);
HttpConnectionParams.setSoTimeout(params, SO_TIMEOUT);

将其中

HttpProtocolParams.setUseExpectContinue(params, true);

改为false问题既解决

posted on 2015-10-26 16:53  HalfmanG2  阅读(373)  评论(0编辑  收藏  举报