19
2024
04

51Tracking 快递接口 库

//API51Tracking v3 api
namespace com;
class API51Tracking{
    ctor(/*输入构造函数所需要的参数*/){ 
        import string;      
        import web.rest.jsonLiteClient; 
    };
    
    //
    setkey = function(apikey){
        
        var http = web.rest.jsonLiteClient();   
            http.addHeaders = {
                "Content-Type":"application/json";
                "Tracking-Api-Key":apikey;
            };      
        
        this.api_url = "https://api.51Tracking.com/v3/trackings";
        this.send = http.api(this.api_url+"/{...}");
            
        //test
        this.http = http;   
    };
    
    
    //添加物流
    create = function(txt_json){
        
        /**
         {
            "tracking_number": "UB209300714LV",
            "courier_code": "cainiao"
        
        }
        **/
        
        return  this.send.create(txt_json);
        
    };
    
    //查询物流
    query = function(txt_json){ 
        //{"tracking_numbers": "UB209300714LV"}
        //用/get的方法,关键字get,用getGet,看提示
        return this.send.getGet(txt_json);
    };
    
    
    type=me;
    /*对象的所有成员必须用分号分隔*/
}

相关文章

« 上一篇 如何在aardio语言中实现从1累加到100的for循环
« 下一篇 内存回收

评论列表:

1 楼.arder   2024-05-17 09:35:51  回复该评论 
没有评论
我顶 (0 我踩 (0 举报 (0回复
更多评论>>

发表评论:


◎欢迎参与讨论