fxd980519
 
public string getOrderTracesByJson() { string ApiKey = "XXXXXXXXX";//请把XXXXXX修改成您在快递100网站申请的APIKey string typeCom = "zhaijisong";//物流公司编码,一般以拼音作为编码 string nu = "4958680939";//快递编号 //GET请求快递100的路径地址,,他是以get请求方式 //show参数表示返回的方式:0.JSON格式 1.html格式 2.字符串格式 string apiurl = "http://api.kuaidi100.com/api?id=" + ApiKey + "&com=" + typeCom + "&nu=" + nu + "&show=0&muti=1&order=asc"; //下面就是请求浏览器并返回内容 WebRequest request = WebRequest.Create(@apiurl); WebResponse response = request.GetResponse(); Stream stream = response.GetResponseStream(); Encoding encode = Encoding.UTF8;//返回格式编码 StreamReader reader = new StreamReader(stream, encode); return reader.ReadToEnd(); }

以上代码是快递100提供的,就这么一点,不用考虑太多。很多的物流接口文档都很简易,只需要在你所需要的官网上去申请一个KEY

并在官网上下载一份demo,直接替换你申请的KEY就可以了

分类:

技术点:

相关文章:

  • 2021-12-04
  • 2021-09-14
  • 2022-02-12
  • 2022-12-23
  • 2021-11-18
  • 2021-11-11
  • 2022-01-17
猜你喜欢
  • 2021-12-10
  • 2021-07-28
  • 2021-11-04
  • 2021-11-09
  • 2021-07-07
  • 2021-09-11
  • 2021-11-03
相关资源
相似解决方案