51Testing软件测试论坛

标题: VB6用inet控件对接api的语法问题 [打印本页]

作者: 测试积点老人    时间: 2020-5-26 13:15
标题: VB6用inet控件对接api的语法问题
VB6用inet控件对接api的语法问题
Postman测试结果如下:
  1. POST /api/CommissionOrder/CreateOPlatform HTTP/1.1
  2. Host: sbpi.pinbao.com.cn
  3. Authorization: OAuth oauth_consumer_key="f575053ae9914440…….
  4. Content-Type: application/json
  5. {"OrderNo":"test20200324","BondedType":"3","CustomsCode":"5330","ProductAmount":"116","ShippingAmount":"0",……
  6. 我用VB6 的iNET控件总是回应不正确:
  7. Private Sub CommandButton1_Click() 'POST
  8. strSendHeader = "POST /api/CommissionOrder/CreateOPlatform HTTP/1.1" & vbCrLf
  9. strSendHeader = strSendHeader & "Authorization: OAuth oauth_consumer_key=" & Chr(34) & "f575053ae9914440…….
  10. strSendHeader = strSendHeader & "Content-Type: application/json" & vbCrLf
  11. strsenddata = TextBox2.Text
  12. strsendadd = "POST <a href="http://sbpi.pinbao.com.cn/api/CommissionOrder/CreateOPlatform">http://sbpi.pinbao.com.cn/api/CommissionOrder/CreateOPlatform</a>"
  13. Inet1.Protocol = icHTTP
  14. Inet1.Execute strsendadd, "POST", strsenddata, strSendHeader
  15. End Sub
  16. Private Sub Inet1_StateChanged(ByVal State As Integer)
  17. Dim getvalue
  18. If State = 12 Then
  19. getvalue = Inet1.GetChunk(1024)
  20. TextBox1.Text = getvalue
  21. End If
  22. End Sub
  23. Textbox2的内容是: {"OrderNo":"test20200324","BondedType":"3","CustomsCode":"5330","ProductAmount":"116","ShippingAmount":"0",……
  24. 但结果出现错误 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