我正在将数据从 android 发送到 web,它使用 httpclient 使用这样的代码
DefaultHttpClient client = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://host");
List<BasicNameValuePair> nvps = new ArrayList<BasicNameValuePair>();
nvps.add(new BasicNameValuePair("method", "signIn"));
nvps.add(new BasicNameValuePair("email",u));
nvps.add(new BasicNameValuePair("password",pass));
UrlEncodedFormEntity p_entity = new UrlEncodedFormEntity(nvps,HTTP.UTF_8);
httppost.setEntity(p_entity);
我有点困惑,如果这段代码将参数作为参数放入 url,就像url?method=a&email=b&password=c
或将参数放入帖子正文
我应该做的是构造一个http帖子到这个url url?method=a 在帖子正文中使用电子邮件和密码参数