Work Notes (How to get the current json keys when you don't know the json key)
String json="{'name':'angui','age':'23','like':'eat fruit'}";JSONObject j = JSON.parseObject(json);j.remove("age");System.out.println(json.toString());System.out.println(j.toJSONString());//Convert json to the form of key=value&key=value&... StringBuilder sb = new StringBuilder();String sbString="";try {org.json.JSONObject jsonObject = new org.json.JSONObject(json);Iterator iterator = jsonObject.keys(); while(iterator.hasNext()){String key = (String) iterator.next(); sb.append("&"+key); sb.append("="+jsonObject.getString(key));}sb.append("&key");sbString = sb.substring(1);} catch (JSONException e) {e.printStackTrace();}System.out.println(sbString);All the key methods for obtaining json in the above java are all the content shared by the editor. I hope it can give you a reference and I hope you can support Wulin.com more.