接口返回字符串如下:
字符串sr:{"success":"1","data":{"status":1,"info":"\u7528\u6237\u5b58\u5728"},"err_info":"","err_code":"","session":null}
如何拿到对应data中的status的值啊?
我是这么写的:
String sr = HttpRequest.sendPost("url", param);
Map<String, Object> map = JsonUtil.jsonToMap(sr);
String code = (String) map.get("success");
int success = Integer.valueOf(code);
Object obj = map.get("data");
Map<String, Object> mapdata = JsonUtil.jsonToMap(obj.toString()+"");
就报了如下错误:
org.codehaus.jackson.JsonParseException: Unexpected character ('s' (code 115)): was expecting double-quote to start field name
字符串sr:{"success":"1","data":{"status":1,"info":"\u7528\u6237\u5b58\u5728"},"err_info":"","err_code":"","session":null}
如何拿到对应data中的status的值啊?
我是这么写的:
String sr = HttpRequest.sendPost("url", param);
Map<String, Object> map = JsonUtil.jsonToMap(sr);
String code = (String) map.get("success");
int success = Integer.valueOf(code);
Object obj = map.get("data");
Map<String, Object> mapdata = JsonUtil.jsonToMap(obj.toString()+"");
就报了如下错误:
org.codehaus.jackson.JsonParseException: Unexpected character ('s' (code 115)): was expecting double-quote to start field name