//响应体返回的json数据
/*
{
"id": 20,
"name": "广西中医药大学附属瑞康医院",
"address": "广西",
"leavl": "三甲"
},
{
"id": 21,
"name": "广西壮族自治区民族医院",
"address": "广西",
"leavl": "三甲"
},
{
"id": 22,
"name": "桂林市第二人民医院",
"address": "广西",
"leavl": "三甲"
},
{
"id": 23,
"name": "山西省长治市中医医院",
"address": "山西省",
"leavl": "三甲"
},
*/
String JSonstr = responseStr.body().string();
//转成json列表
JSONArray arrayJson =new JSONArray(JSonstr);
//获取第一条
arrayJson.get(0).toString()
//将第一条转成JSonObject
JSONobject js = arrayJson.getJSONObject(0);
扫描二维码,在手机上阅读!
评论