51Testing软件测试论坛
标题:
新手求救,java解析JSON,想获取providerid+name,求大神解救
[打印本页]
作者:
ouyanggengcheng
时间:
2015-12-25 11:44
标题:
新手求救,java解析JSON,想获取providerid+name,求大神解救
{"code":0,"msg":"请求成功!","data":{"total":6,"page":1,"pageSize":15,"sort":"desc","pageData":
[{"spec":"","providerid":10221,"status":"USING","largeImage":"","referenceprice":0.0,"serialNumber":"","provider":"","type":1,"cost":0.0,"integral":0,"id":10923,"transactionprice":0.0,"description":"","name":"test","smallImage":""},
{"spec":"","providerid":10221,"status":"USING","largeImage":"","referenceprice":11.0,"serialNumber":"2","provider":"","type":1,"cost":10.0,"integral":0,"id":10922,"transactionprice":10.0,"description":"详情","name":"测试","smallImage":""},
{"spec":"100","providerid":10221,"status":"USING","largeImage":"","referenceprice":30.0,"serialNumber":"8","provider":"","type":1,"cost":20.0,"integral":0,"id":10918,"transactionprice":20.0,"description":"详情","name":"礼品","smallImage":""}]
作者:
joykao
时间:
2015-12-25 13:45
用JSONObject.parseObject去解析返回结果,比如get请求就可以这样JSONObject jsonObj = JSONObject.parseObject(rc.get());然后再用jsonObj.getString去去key的值取不出来?
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2