引入fastjson包
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
JSON.parseObject方法把返回的数据流转换json数据
JSONObject obj = JSON.parseObject(“HttpResponse返回的数据流”);
//map对象
Map<String, Object> data = new HashMap<>();
//循环转换
Iterator it = obj.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, Object> entry = (Map.Entry<String, Object>) it.next();
data.put(entry.getKey(), entry.getValue());
}