举个例子,如何只通过一个单号,获取到物流单号的物流信息。要用到下面两个接口,免费,无需注册快递100的key就可以用。
智能识别接口
接口地址:http://www.kuaidi100.com/autonumber/autoComNum?text=[单号]
请求方式:GET
物流详情接口
接口地址:http://www.kuaidi100.com/query?type=[comCode]&postid=[单号]
请求方式:GET
- 用快递100页面的快递单号例子
2.先通过智能接口,获取物流公司编码,获取的数据作为参数,通过物流接口去获取物流信息。
var type;
var postid = '640025148516';
wx.request({
url: 'http://www.kuaidi100.com/autonumber/autoComNum',
data: {
text: postid
},
method: 'GET',
success: function(res){
console.log(res)
var type = res.data.auto[0].comCode;
},
complete: function(){
wx.request({
url: 'http:/