HttpClient client = new HttpClient();
form表单提交数据:
PostMethod post = new PostMethod(具体的url);
post.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=utf-8");
NameValuePair[] param = {
new NameValuePair("postid",expressNum),
new NameValuePair("type",expressCompany)
};
post.setRequestBody(param);
post.releaseConnection();
client.executeMethod(post);
//处理json串
String response = post.getResponseBodyAsString();
JSONObject jsonStr = JSONObject.fromObject(response);
JSONArray jsonArray = jsonStr.getJSONArray("data");
//循环添加到infolist中
if (jsonArray!=null&&jsonArray.size()>0) {
for (int i=0