怎么获取安卓apk请求的json地址?
HttpClient client = new HttpClient();
PostMethod post = new PostMethod("your url");
//准备参数,可以是多个
NameValuePair simcard = new NameValuePair("key","value");
post.setRequestBody(new NameValuePair[]{simcard});
//执行请求
client.executeMethod(method);
//获取返回值
String response = new String(method.getResponseBodyAsString().getBytes("iso-8859-1"));
//把json字符串转换为对象,有很多方法
SONObject result = new JSONObject(response);
Copyright © 广州京杭网络科技有限公司 2005-2025 版权所有 粤ICP备16019765号
广州京杭网络科技有限公司 版权所有