中国天气网接口返回问题
        string areaid = "101010100";
        string type = "forecast_v";
        string date = DateTime.Now.ToString("yyyyMMddHHmm");

接口返回数据为:
{"c":{"c1":"101010100","c2":"beijing","c3":"北京","c4":"beijing","c5":"北京","c6":"beijing","c7":"北京","c8":"china","c9":"中国","c10":"1","c11":"010","c12":"100000","c13":116.391000,"c14":39.904000,"c15":"33","c16":"AZ9010","c17":"+8"},"f":{"f1":[{"fa":"00","fb":"01","fc":"32","fd":"20","fe":"0","ff":"0","fg":"0","fh":"0","fi":"04:45|19:40"},{"fa":"02","fb":"04","fc":"31","fd":"22","fe":"0","ff":"0","fg":"0","fh":"0","fi":"04:45|19:41"},{"fa":"21","fb":"04","fc":"30","fd":"20","fe":"0","ff":"0","fg":"0","fh":"0","fi":"04:45|19:42"}],"f0":"201506081100"}}
以上返回的json数据是什么意思?

3个回答

101010100 城市编码
c13":116.391000,"c14":39.904000," 经纬度
c17":"+8" 时区
fc":"31","fd":"22" 最高温度最低温度
201506081100发布时间
别的就很难懂了。
感觉参数被混淆了一样。

你应该对照着中国天气网中显示的数据,来核对这些字段,大部分应该是可以对上的,如果他是公开的接口,应该会提供相关说明才是

能做的就是帮你格式化一下json,具体字段意思要么猜,要么找做过的人核对。

{
"c": {
"c1": "101010100",
"c2": "beijing",
"c3": "北京",
"c4": "beijing",
"c5": "北京",
"c6": "beijing",
"c7": "北京",
"c8": "china",
"c9": "中国",
"c10": "1",
"c11": "010",
"c12": "100000",
"c13": 116.391,
"c14": 39.904,
"c15": "33",
"c16": "AZ9010",
"c17": "+8"
},
"f": {
"f1": [
{
"fa": "00",
"fb": "01",
"fc": "32",
"fd": "20",
"fe": "0",
"ff": "0",
"fg": "0",
"fh": "0",
"fi": "04:45|19:40"
},
{
"fa": "02",
"fb": "04",
"fc": "31",
"fd": "22",
"fe": "0",
"ff": "0",
"fg": "0",
"fh": "0",
"fi": "04:45|19:41"
},
{
"fa": "21",
"fb": "04",
"fc": "30",
"fd": "20",
"fe": "0",
"ff": "0",
"fg": "0",
"fh": "0",
"fi": "04:45|19:42"
}
],
"f0": "201506081100"
}
}

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问