HttpClient client = new DefaultHttpClient();
HttpPost httpPost = new HttpPost("http://www.dudu.com/api.php");
ArrayList<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("key", "aaaa"));
params.add(new BasicNameValuePair("method", "bbbb"));
httpPost.setEntity(new UrlEncodedFormEntity(params));
HttpResponse response = client.execute(httpPost);
请问我这样写为什么得不到正确结果呢?
HttpPost httpPost = new HttpPost("http://www.dudu.com/api.php");
ArrayList<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("key", "aaaa"));
params.add(new BasicNameValuePair("method", "bbbb"));
httpPost.setEntity(new UrlEncodedFormEntity(params));
HttpResponse response = client.execute(httpPost);
请问我这样写为什么得不到正确结果呢?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货