JSONObject JSONObject

String response=httpClientUtil.doGet(url, params);
//处理resposne
JSONObject json = JSONObject.parseObject(response);
JSONArray items=json.getJSONArray(""
+ "items"); //将json字符串转成json数组
for (int i = 0; i < items.size(); i++) { //循环json数组
JSONObject ob = items.getJSONObject(i);//得到json对象
name=ob.getString("name");//name这里是列名称,获取json对象中列名为name的值
path=ob.getString("path");
System.out.println(path);
}

 

   

相关文章