以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  快递接口的问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=122848)

--  作者:rjh4078
--  发布时间:2018/8/3 0:39:00
--  快递接口的问题
已经购买了code,请教下如何动态合成查询条件
比如 韵达快递 单号是001
申通快递 单号是999
如何合成到查询地址中去?
Dim hc As New HttpClient("http://ali-deliver.showapi.com/showapi_expInfo?com=yunda&nu=001")
hc.Headers.Add("Authorization","APPCODE " & "7858a126750949e4a36371580f420413")

Dim
jo As JObject = Jobject.Parse(hc.GetData)
If
jo("showapi_res_body")("data") IsNot Nothing Then
    For Each jt As JToken In jo("showapi_res_body")("data")
        Output.Show(jt("time").ToString & " | " & jt("context").ToString)
   
Next
End
If

这种方式报错啊

--  作者:有点甜
--  发布时间:2018/8/3 9:58:00
--  

1、哪里的快递接口?接口的说明是怎样的?贴出来看看。

 

2、看懂httpclient,根据需求设置请求 http://www.foxtable.com/mobilehelp/scr/0163.htm

 


--  作者:rjh4078
--  发布时间:2018/8/3 12:32:00
--  
我的意思就是用阿里云全国物流查询接口这个
--  作者:有点甜
--  发布时间:2018/8/3 16:37:00
--  

我这样测试没问题

 

Dim hc As New HttpClient("http://ali-deliver.showapi.com/showapi_expInfo?com=yuantong&nu=800851552555646645")
hc.Headers.Add("Authorization","APPCODE " & "278b315cabac4df9a39478de0a8321ad")
msgbox(hc.GetData)

 

这样测试也没问题

 

Dim url As String = "http://ali-deliver.showapi.com/showapi_expInfo?com=yuantong&nu=800851552555646645"
Dim rqst As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(url)
rqst.Method = "GET"
rqst.Headers.Add("Authorization","APPCODE " & "278b315cabac4df9a39478de0a8321ad")
Dim rsps As System.Net.HttpWebResponse = rqst.GetResponse
Dim stm As System.IO.Stream = rsps.GetResponseStream()
Dim reader As New System.IO.StreamReader(stm,encoding.utf8)
Dim str As String = reader.ReadToEnd  
stm.Dispose()
msgbox(str)

 

你单号不能填错

[此贴子已经被作者于2018/8/3 17:08:53编辑过]