以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 提交josn数据 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=179048) |
||||
-- 作者:fendouww -- 发布时间:2022/8/4 14:30:00 -- 提交josn数据 阿里云接口地址 https://global.link.cainiao.com/?#/homepage/api/logistics/electronic_sheet/CLOUDPRINT_PRINTER_PRINT?_k=17cfxr 官方人员给出的对接代码 主要问题是在printData的data数据提交上,我用以下代码提交总是出错
,请问是哪里不对吗?报错内容见附件 Dim url As String = "https://link.cainiao.com/gateway/link.do" Dim hc As New HttpClient(url) Dim jo As New JObject jo("userId") = CStr(Vars("userId")) jo("sharedCode") = CInt(Vars("sharedCode")) jo("printerId") = CStr(Vars("printerId")) jo("printData") = New JObject jo("printData")("templateUrl") = CStr(Vars("templateUrl")) jo("printData")("encrypted") = False jo("printData")("data") = New JObject jo("printData")("data")("cut_time") = Date.Now jo("printData")("data")("typeno") = CStr(60253156425) jo("printData")("data")("color") = CStr("红色") jo("printData")("data")("bed_size") = CStr("M") jo("printData")("data")("sign") = CStr(6) jo("printData")("data")("num") = CStr(25) jo("printData")("data")("sign_num") = CStr(50) jo("printData")("data")("size_num") = CStr(1250) jo("printData")("data")("position") = CStr("前片") jo("printData")("data")("company_name") = CStr("1") jo("printData")("data")("fa_name") = CStr("1") jo("printData")("data")("printdes") = CStr("1") jo("printData")("data")("code_url") = CStr("https://www.baidu.com") Dim data As String = (jo.ToString) hc.FormData.Add("msg_type", "CLOUDPRINT_PRINTER_PRINT") hc.FormData.Add("to_code", "") hc.FormData.Add("logistic_provider_id", Vars("token")) hc.FormData.Add("logistics_interface", data) Dim s As String = Functions.Execute("MD5", data & Vars("appsecret"), 2) hc.FormData.Add("data_digest", s) Dim ret As String = hc.GetData() |
||||
-- 作者:有点蓝 -- 发布时间:2022/8/4 14:35:00 -- 找官方给.net的示例代码 |
||||
-- 作者:fendouww -- 发布时间:2022/8/4 15:00:00 -- 老师,可以想想其他办法吗?官方给出了这个地址,并说明接口没有.net示例 https://global.link.cainiao.com/?#/homepage/doc/29?_k=wu11ej
|
||||
-- 作者:fendouww -- 发布时间:2022/8/4 15:01:00 -- 如果接口不通,我就没有办法开展下一步了 |
||||
-- 作者:有点蓝 -- 发布时间:2022/8/4 16:07:00 -- 我也没办法。看不懂 |