使用Postman获取天气接口API(Json格式)

您所在的位置:网站首页 天气预报api接口测试 使用Postman获取天气接口API(Json格式)

使用Postman获取天气接口API(Json格式)

2023-12-14 08:11| 来源: 网络整理| 查看: 265

一、接口URL http://wthrcdn.etouch.cn/weather_mini 二、请求参数 参数名称类型是否必须说明provincestring1对应哪个省citystring1对应哪个城市 三、使用Postman发起Get请求

在这里插入图片描述 以下为请求得到的数据: {“data”:{“yesterday”:{“date”:“28日星期一”,“high”:“高温 28℃”,“fx”:“无持续风向”,“low”:“低温 21℃”,“fl”:"",“type”:“多云”},“city”:“深圳”,“forecast”:[{“date”:“29日星期二”,“high”:“高温 27℃”,“fengli”:"",“low”:“低温 20℃”,“fengxiang”:“无持续风向”,“type”:“晴”},{“date”:“30日星期三”,“high”:“高温 27℃”,“fengli”:"",“low”:“低温 20℃”,“fengxiang”:“东北风”,“type”:“多云”},{“date”:“31日星期四”,“high”:“高温 27℃”,“fengli”:"",“low”:“低温 21℃”,“fengxiang”:“东北风”,“type”:“晴”},{“date”:“1日星期五”,“high”:“高温 28℃”,“fengli”:"",“low”:“低温 22℃”,“fengxiang”:“东北风”,“type”:“晴”},{“date”:“2日星期六”,“high”:“高温 28℃”,“fengli”:"",“low”:“低温 22℃”,“fengxiang”:“无持续风向”,“type”:“晴”}],“ganmao”:“各项气象条件适宜,无明显降温过程,发生感冒机率较低。”,“wendu”:“23”},“status”:1000,“desc”:“OK”}

所以,在后续写程序的过程中,我们应当以Json的格式来解析这部分数据,得到我们想要的接口



【本文地址】


今日新闻


推荐新闻


    CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3