一、参考文章
1.使用天气接口https://blog.csdn.net/u011050631/article/details/48230947
二、步骤
- 建立tcp链接 地址为:
weather.com.cn
- 发送GET 注意最下面有2个\r\n
GET /data/sk/101280101.html HTTP/1.1 Host: www.weather.com.cn
- 得到数据返回 这里显示乱码,因为编码问题
{"weatherinfo":{"city":"骞垮窞","cityid":"101280101","temp":"26.6","WD":"涓滃崡椋?","WS":"灏忎簬3绾?","SD":"83%","AP":"1001.4hPa","njd":"鏆傛棤瀹炲喌","WSE":"<3","time":"17:50","sm":"1.7","isRadar":"1","Radar":"JC_RADAR_AZ9200_JB"}}
- LOG如下图我用透传固件测试