首页 > 代码库 > Json总结
Json总结
Json格式
基本格式
变量名:值
"title":"肖申克的救赎"
值可以是结构体(类),如下,用大括号括起来:
"images":{"small":"http:\/\/img3.douban.com\/view\/movie_poster_cover\/ipst\/public\/p480747492.jpg","large":"http:\/\/img3.douban.com\/view\/movie_poster_cover\/lpst\/public\/p480747492.jpg","medium":"http:\/\/img3.douban.com\/view\/movie_poster_cover\/spst\/public\/p480747492.jpg"},
值可以是数组,如下,用中括号括起来:
"genres":["犯罪","剧情"],
数组可以由结构体(类)构成:
"casts":[{"avatars":{"small":"http:\/\/img3.douban.com\/img\/celebrity\/small\/17525.jpg","large":"http:\/\/img3.douban.com\/img\/celebrity\/large\/17525.jpg","medium":"http:\/\/img3.douban.com\/img\/celebrity\/medium\/17525.jpg"},"alt":"http:\/\/movie.douban.com\/celebrity\/1054521\/“,”id":"1054521","name":"蒂姆·罗宾斯"},{"avatars":{"small":"http:\/\/img3.douban.com\/img\/celebrity\/small\/34642.jpg","large":"http:\/\/img3.douban.com\/img\/celebrity\/large\/34642.jpg","medium":"http:\/\/img3.douban.com\/img\/celebrity\/medium\/34642.jpg"},"alt":"http:\/\/movie.douban.com\/celebrity\/1054534\/","id":"1054534","name":"摩根·弗里曼”},{“avatars":{"small":"http:\/\/img5.douban.com\/img\/celebrity\/sL;POL,mall\/5837.jpg","large":"http:\/\/img5.douban.com\/img\/celebrity\/large\/5837.jpg","medium":"http:\/\/img5.douban.com\/img\/celebrity\/medium\/5837.jpg"},"alt":"http:\/\/movie.douban.com\/celebrity\/1041179\/","id":"1041179","name":"鲍勃·冈顿"}],
举例
http://api.douban.com/v2/movie/top250
{"rating":{"max":10,"average":9.6,"stars":"50","min":0},"genres":["犯罪","剧情"],"collect_count":783892,"casts":[{"avatars":{"small":"http:\/\/img3.douban.com\/img\/celebrity\/small\/17525.jpg","large":"http:\/\/img3.douban.com\/img\/celebrity\/large\/17525.jpg","medium":"http:\/\/img3.douban.com\/img\/celebrity\/medium\/17525.jpg"},"alt":"http:\/\/movie.douban.com\/celebrity\/1054521\/“,”id":"1054521","name":"蒂姆·罗宾斯"},{"avatars":{"small":"http:\/\/img3.douban.com\/img\/celebrity\/small\/34642.jpg","large":"http:\/\/img3.douban.com\/img\/celebrity\/large\/34642.jpg","medium":"http:\/\/img3.douban.com\/img\/celebrity\/medium\/34642.jpg"},"alt":"http:\/\/movie.douban.com\/celebrity\/1054534\/","id":"1054534","name":"摩根·弗里曼”},{“avatars":{"small":"http:\/\/img5.douban.com\/img\/celebrity\/sL;POL,mall\/5837.jpg","large":"http:\/\/img5.douban.com\/img\/celebrity\/large\/5837.jpg","medium":"http:\/\/img5.douban.com\/img\/celebrity\/medium\/5837.jpg"},"alt":"http:\/\/movie.douban.com\/celebrity\/1041179\/","id":"1041179","name":"鲍勃·冈顿"}],"title":"肖申克的救赎","original_title":"The Shawshank Redemption","subtype":"movie","directors":[{"avatars":{"small":"http:\/\/img3.douban.com\/img\/celebrity\/small\/230.jpg","large":"http:\/\/img3.douban.com\/img\/celebrity\/large\/230.jpg","medium":"http:\/\/img3.douban.com\/img\/celebrity\/medium\/230.jpg"},"alt":"http:\/\/movie.douban.com\/celebrity\/1047973\/","id":"1047973","name":"弗兰克·德拉邦特"}],"year":"1994","images":{"small":"http:\/\/img3.douban.com\/view\/movie_poster_cover\/ipst\/public\/p480747492.jpg","large":"http:\/\/img3.douban.com\/view\/movie_poster_cover\/lpst\/public\/p480747492.jpg","medium":"http:\/\/img3.douban.com\/view\/movie_poster_cover\/spst\/public\/p480747492.jpg"},"alt":"http:\/\/movie.douban.com\/subject\/1292052\/","id":"1292052"},
Json总结
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。