//6.处理返回的内容
//JSONObject jsonObject = JSONObject.fromObject(responseMsg);//JSONObject解析
JSONArray listJson = JSONArray.fromObject(responseMsg);//JSONArray解析 "[{},{},{}]"
for(int i=0; i<listJson.size(); i++){
JSONObject jsonObject = listJson.getJSONObject(i);
String canteenName = jsonObject.getString("canteenName");
String employeeName = jsonObject.getString("employeeName");
System.out.println("canteenName:" + canteenName);
System.out.println("employeeName:" + employeeName);
}
HTTP接口返回值解析 JSONObject及JSONArray
最新推荐文章于 2021-10-11 14:18:24 发布