当前位置:首页>科技>正文

怎么获取安卓apk请求的json地址

2023-04-28 07:09:43 互联网 未知 科技

 怎么获取安卓apk请求的json地址

怎么获取安卓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)