测试积点老人 发表于 2020-5-26 13:15:47

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

海海豚 发表于 2020-5-27 09:26:24

fiddler抓包对比下

郭小贱 发表于 2020-5-27 10:03:20

自己抓包解析对比下看看哪里有问题啊

jingzizx 发表于 2020-5-27 10:43:30

多对比,打印查看是否一致

bellas 发表于 2020-5-27 10:44:12

fiddler抓包对比下

qqq911 发表于 2020-5-27 11:32:24

url有问题
页: [1]
查看完整版本: VB6用inet控件对接api的语法问题