JSON

import com.alibaba.fastjson.JSON;

import com.alibaba.fastjson.JSONObject;

String formDataStr = JSONObject.toJSONString(dRequest); //将对象转换为json字符串

resString = resource.post(String.class, formData); //{"errorCode":"4001","errorMessage":"接收业务通知失败,请稍后再试!","timestamp":"20180824093923"}
JSONObject jsStr = JSON.parseObject(resString); //HashMap$Node<K,V> 将json字符串转为可取值
String errorCode = jsStr.getString("errorCode");
String errorMessage = jsStr.getString("errorMessage");

拼命敲
原文地址:https://www.cnblogs.com/wuyuwuyueping/p/9528181.html