当我使用Firefox的“REST客户端”或谷歌浏览器的“简单REST客户端”测试它时,我的API似乎正在工作完美。但是,当我使用Android SDK发送Http请求时,以下情况除外:Android Http请求ClientProtocolException
ClientProtocolException:服务器无法以有效的HTTP响应
还当我测试使用谷歌Chrome浏览器的“高级REST客户端”回应我有一个空的响应,所以什么可能会导致此任何想法?
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpResponse httpResponse = null;
HttpPost httpPost = new HttpPost(Constants.URL);
httpPost.setHeader("Content-Type", "application/json");
httpPost.setHeader("Accept", "application/json");
StringEntity se = new StringEntity(params,HTTP.UTF_8);
httpPost.setEntity(se);
httpClient.execute(httpPost);
任何运气?我有类似的问题 – amadib