以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- post提交数据 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=178255) |
-- 作者:lxhmax -- 发布时间:2022/6/25 19:33:00 -- post提交数据 Dim st As New Date(1970,1,1,8,0,0) Dim timeSign As Long = CLng((Date.Now - st).TotalMilliseconds()) Dim clientId As String = "aeeragerwqerwertwer" Dim jiekou As String = "sale/company/posthouse" Dim tokenSign As String = CExp(clientId & timeSign & Functions.Execute("tokenSign")) tokenSign =Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(tokenSign, "MD5").ToLower() Dim url As String = "http://hu.com/gateway/" & jiekou & "?clientId={0}&timeSign={1}&tokenSign={2}" Dim requrl As String = CExp(url,clientId,timeSign,tokenSign) Dim jo As New JObject jo("bianhao") = CStr("11111") jo("xiaoquId") = CStr("22222") jo("shi") = CStr("3") jo("ting") = CStr("2") jo("wei") = CStr("1") ..... 这里的传输字段有30个左右~ Dim bodystr As String = jo.ToString Output.Show(requrl) Output.Show(bodystr) Dim hc As New HttpClient(requrl) hc.Content = jo.ToString jo = JObject.Parse(hc.GetData) Output.Show(jo.ToString) 请问老师,这个要怎样才能将红色部分转换成下面的方式post数据 http://hu.com/gateway/sale/company/posthouse?clientId=aeeragerwqerwertwer&timeSign=1656156489173&tokenSign=b105ba7f6dbe7d200af3437fa387288d&bianhao=11111&xiaoquId=22222&shi=3&ting=2&wei=1....
[此贴子已经被作者于2022/6/26 10:26:35编辑过]
|
-- 作者:有点蓝 -- 发布时间:2022/6/26 20:11:00 -- 如果是post方式提交数据,和url没有什么关系呀。加上ContentType试试 Dim hc As New HttpClient(requrl) hc.ContentType = "application/json" hc.Content = jo.ToString dim res as string = hc.GetData Output.Show(res ) |