zoukankan      html  css  js  c++  java
  • 空气质量监测演示代码

    空气质量监测接口返回示例

    接口信息 URL:http://apis.haoservice.com/air/cityair

    支持格式:json

    http请求方式:GET POST DEMO:http://apis.haoservice.com/air/cityair?city=城市名称&key=您申请的APPKEY值

    返回结果: {    

    "error_code": 0,    

    "reason": "成功",    

    "result": {        

    "Ranking": 83,        

    "CityName": "深圳市",        

    "ProvinceName": "广东省",        

    "AQI": 58,        

    "Quality": "良",        

    "PM25": "36μg/m³",        

    "UpdateTime": "2014-04-27 21:00"     }

    }

    演示示例代码:

    using System;

    using System.Text;

    using System.Net;

    namespace map

    {    

             class Program    

             {        

                      static void Main(string[] args)        

                     {            

                       string key = "1a2897d9723a45059fc6e6430b59adcc";            

                       string city="北京";            

                       string url = "http://apis.haoservice.com/air/cityair?city="+city+"&key="+key;            

                       WebClient wc = new WebClient();            

                       wc.Encoding = Encoding.UTF8;            

                       string str = wc.DownloadString(url);            

                       Console.WriteLine(str);            

                       Console.ReadKey();

                      }    

              }

    }

  • 相关阅读:
    TCP通信 小例子
    Socket的简单使用
    Redis练习
    资料
    Redis封装帮助类
    使用Redis的基本操作
    Redis配置主从
    Redis基本设置
    clientHeight ,offsetHeight,style.height,scrollHeight的区别与联系
    服务器操作之如何绑定网站
  • 原文地址:https://www.cnblogs.com/haoservice/p/3973232.html
Copyright © 2011-2022 走看看