51Testing软件测试论坛
标题:
VB6用inet控件对接api的语法问题
[打印本页]
作者:
测试积点老人
时间:
2020-5-26 13:15
标题:
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
fiddler抓包对比下
作者:
郭小贱
时间:
2020-5-27 10:03
自己抓包解析对比下看看哪里有问题啊
作者:
jingzizx
时间:
2020-5-27 10:43
多对比,打印查看是否一致
作者:
bellas
时间:
2020-5-27 10:44
fiddler抓包对比下
作者:
qqq911
时间:
2020-5-27 11:32
url有问题
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2