我在 android 上使用 apache.http 并且大部分工作正常但是当我尝试使用参数执行获取请求时,这些也不会被发送。我究竟做错了什么?这是代码
HttpClient httpclient = new DefaultHttpClient();
HttpUriRequest request = new HttpGet(uri);
HttpParams p = new BasicHttpParams();
p.setParameter("param", "value");
request.setParams(p);
request.setHeader("Accept", "application/json, text/javascript, */*; q=0.01");
HttpResponse response = null;
try {
response = httpclient.execute(request);
} catch (ClientProtocolException e) {
e.printStackTrace();
}
在服务器上我只得到这个没有参数
GET /api/v1/activity/ HTTP/1.1
Host: example.com
Connection: Keep-Alive
Accept-Encoding: gzip
Accept: application/json, text/javascript, */*; q=0.01
有任何想法吗?