VB6用inet控件对接api的语法问题
VB6用inet控件对接api的语法问题Postman测试结果如下:
POST /api/CommissionOrder/CreateOPlatform HTTP/1.1
Host: sbpi.pinbao.com.cn
Authorization: OAuth oauth_consumer_key="f575053ae9914440…….
Content-Type: application/json
{"OrderNo":"test20200324","BondedType":"3","CustomsCode":"5330","ProductAmount":"116","ShippingAmount":"0",……
我用VB6 的iNET控件总是回应不正确:
Private Sub CommandButton1_Click() 'POST
strSendHeader = "POST /api/CommissionOrder/CreateOPlatform HTTP/1.1" & vbCrLf
strSendHeader = strSendHeader & "Authorization: OAuth oauth_consumer_key=" & Chr(34) & "f575053ae9914440…….
strSendHeader = strSendHeader & "Content-Type: application/json" & vbCrLf
strsenddata = TextBox2.Text
strsendadd = "POST <a href="http://sbpi.pinbao.com.cn/api/CommissionOrder/CreateOPlatform">http://sbpi.pinbao.com.cn/api/CommissionOrder/CreateOPlatform</a>"
Inet1.Protocol = icHTTP
Inet1.Execute strsendadd, "POST", strsenddata, strSendHeader
End Sub
Private Sub Inet1_StateChanged(ByVal State As Integer)
Dim getvalue
If State = 12 Then
getvalue = Inet1.GetChunk(1024)
TextBox1.Text = getvalue
End If
End Sub
Textbox2的内容是: {"OrderNo":"test20200324","BondedType":"3","CustomsCode":"5330","ProductAmount":"116","ShippingAmount":"0",……
但结果出现错误 URL is malformed
fiddler抓包对比下 自己抓包解析对比下看看哪里有问题啊 多对比,打印查看是否一致 fiddler抓包对比下 url有问题
页:
[1]