51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 2573|回复: 1
打印 上一主题 下一主题

[原创] 新手求救,java解析JSON,想获取providerid+name,求大神解救

[复制链接]
  • TA的每日心情
    郁闷
    2016-6-2 09:34
  • 签到天数: 3 天

    连续签到: 1 天

    [LV.2]测试排长

    跳转到指定楼层
    1#
    发表于 2015-12-25 11:44:19 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    {"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":""}]
    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏
    回复

    使用道具 举报

  • TA的每日心情
    无聊
    2020-12-8 11:20
  • 签到天数: 605 天

    连续签到: 1 天

    [LV.9]测试副司令

    2#
    发表于 2015-12-25 13:45:05 | 只看该作者
    用JSONObject.parseObject去解析返回结果,比如get请求就可以这样JSONObject jsonObj = JSONObject.parseObject(rc.get());然后再用jsonObj.getString去去key的值取不出来?
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-11-26 00:03 , Processed in 0.063338 second(s), 23 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表