一般传输参数使用json类型或者map类型都是使用post方法。
使用json数据格式发送信息向服务器端:
HttpClient httpClient = new DefaultHttpClient();
try {
HttpPost httpPost = new HttpPost(BASIC_URL + url);
List
JSONObject jsonObject = new JSONObject();
JSONObject jsonObject2 = new JSONObject();
jsonObject.put("uemail", userbean.getEmail());
jsonObject.put("password", userbean.getPassword());
jsonObject2.put("userbean", jsonObject);
nameValuePair.add(new BasicNameValuePair("jsonString", jsonObject
.toString()));
Log.i("lifeweeker", jsonObject2.toString());
httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair));
}