JSONObject jsonObject = new JSONObject();
jsonObject.put("phone","13535023765");
jsonObject.put("multi","1");
String [] arr = new String [jsonObject.size()];
Iterator keys = jsonObject.keys();
for (int i = 0; i < jsonObject.size(); i++) {
String key = String.valueOf(keys.next());
arr[i] = (String) jsonObject.get(key);
}
1.第一种方法
JSONArray params = new JSONArray();
Collection<Object> c = json.values();
for (Object o : c) {
params.add(o);
}
2.第二种方法
nvps.add(new BasicNameValuePair("mobiles", "[\""+mobile+"\"]")); 拼接成数组格式