• 航班查询接口演示


    using System;

    using System.Text;

    using System.Net;

    namespace weizhang

    {

        class Program

        {

            static void Main(string[] args)

            {

                string name="CA5901";

                string key = "**********************";//申请的key值

                string url = "http://apis.haoservice.com/plan/s?name="+name+"&key="+ key;

                WebClient wc = new WebClient();

                wc.Encoding = Encoding.UTF8;

                string str = wc.DownloadString(url);

                Console.WriteLine(str);

                Console.ReadKey();

            }

        }

    }

    URL:http://apis.haoservice.com/plan/s

    支持格式:json

    http请求方式:GET POST

    DEMO:http://apis.haoservice.com/plan/s?name=CA5901&key=yourkey

    返回示例:

    {

        "error_code": 0,

        "reason": "成功",

        "result":

        [

              {

                "name": "HU7779",//航班号

                "complany": "海南航空股份有限公司",//航空公司

                "AirModel": "738",//机型

                "AirAge": null,//机年

                "start": "北京",//起飞城市

                "end": "三亚",//降落城市

                "DepCode": "BeiJing",//起飞城市拼音

                "ArrCode": "SanYa",//降落城市拼音

                "startAirport": "首都机场",//起飞机场

                "endAirport": "凤凰机场",//降落机场

                "status": "到达",//飞机实时状态

                "DepTime": "06:45",//计划起飞时间

                "ArrTime": "10:40",//计划到达时间

                "Dexpected": "06:45 ",//预计起飞时间

                "Aexpected": " 10:40",//预计到达时间

                "Dactual": "06:48 ",//实时起飞时间

                "Aactual": " 10:20",//实时到达时间

                "food": "有餐食   ",//有无餐食

                "OnTimeRate": null,//准点率

                "FlyTime": "3小时32分",//飞行时间

                "Distance": "2710KM  ",//飞行距离

                "AverageDelay": null,//平均延时

                "ScheduleDaysOfWeek": "1,2,3,4,5,6,7"//班期(有该航班的星期数,用英文逗号分隔,如一周中有4天:1,2,5,7)

            }

        ]

    }

    备注: 航班查询,要先有key值,然后将自己想要查询的航班等输入; 若出现错误,请查看该网页(http://www.haoservice.com/docs/4/query)上的代码表.

  • 相关阅读:
    AR路由器web界面每IP限速配置方法
    传输层:TCP 协议
    从需求的角度去理解Linux系列:总线、设备和驱动
    京东的个性化推荐系统
    数据挖掘-MovieLens数据集_电影推荐_亲和性分析_Aprioro算法
    Linux时间子系统之七:定时器的应用--msleep(),hrtimer_nanosleep()
    Linux SPI总线和设备驱动架构之四:SPI数据传输的队列化
    拦截器及 Spring MVC 整合
    表现层 JSP 页面实现
    Controller 层实现
  • 原文地址:https://www.cnblogs.com/haoservice/p/3988341.html
Copyright © 2020-2023  润新知