快递查询演示示例

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Net.Security;

using System.Security.Cryptography.X509Certificates;

using System.Net;

using System.IO;

using System.IO.Compression;

using System.Text.RegularExpressions;

using System.Web.Script.Serialization;

namespace map

{

    class Program

    {

        static void Main(string[] args)

        {

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

            string com="yuantong";//(快递公司名称)

            string no = "***************";//(单号)

            string url = "http://apis.haoservice.com/lifeservice/exp?com="+com+"&no="+no+"&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/lifeservice/exp

支持格式:json

http请求方式:GET POST

DEMO:http://apis.haoservice.com/lifeservice/exp?key=您申请的APPKEY值&com=sf&no=575677355677

返回结果:

{

    "error_code":0,

    "reason":"Success",

    "result":

    {

        "company":null,

        "com":"shunfeng",

        "no":"199828654050",

        "list":

        [{

            "time":"2014-09-04 15:30:59",

            "context":"签收人是:已签收"

        },{

            "time":"2014-09-04 15:30:03",

            "context":"派件已签收"

        },{

            "time":"2014-09-04 14:15:05",

            "context":"正在派件..(派件人:杨剑峰,电话:18367205232)"

        },{

            "time":"2014-09-04 12:49:13",

            "context":"快件在湖州集散中心装车, 准备送往下一站湖州"

        },{

            "time":"2014-09-04 10:23:25",

            "context":"快件到达湖州集散中心"

        },{

            "time":"2014-09-04 08:15:00",

            "context":"快件在杭州装车, 准备送往下一站湖州集散中心"

        },{

            "time":"2014-09-04 05:44:42",

            "context":"快件到达杭州"

        },{

            "time":"2014-09-04 01:31:44",

            "context":"快件在上海装车, 准备送往下一站杭州"

        },{

            "time":"2014-09-04 01:26:15",

            "context":"快件到达上海"

        },{

            "time":"2014-09-03 02:07:21",

            "context":"快件在北京装车, 准备送往下一站上海"

        },{

            "time":"2014-09-02 23:50:55",

            "context":"快件在北京集散中心装车, 准备送往下一站北京"

        },{

            "time":"2014-09-02 19:40:14",

            "context":"快件在北京装车, 准备送往下一站北京集散中心"

        }]

    }


}


备注:

先在网页 (http://www.haoservice.com/docs/18)上申请key值,填入参数.

若有错误,请参照一下代码表 

错误代码表:

 返回码 说明

 0     成功

 10001 错误的请求KEY

 10002 该KEY无请求权限

 10003 KEY过期

 10004 错误的SDK KEY

 10005 应用未审核超时,请提交认证

 10007 未知的请求源,(服务器没有获取到IP地址)

 10008 被禁止的IP

 10009 被禁止的KEY

 10011 当前IP请求超过限制

 10012 当前Key请求超过限制

 10013 测试KEY超过请求限制

 10020 接口维护

 10021 接口停用

 10022 appKey按需剩余请求次数为零

 10023 请求IP无效

 10024 网络错误

 10025 没有查询到结果


转载于:https://my.oschina.net/u/2242246/blog/316046

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值