怎么獲取安卓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);
上一篇java中flush
下一篇iCloud是什么