TA的每日心情 | 擦汗 前天 09:07 |
---|
签到天数: 527 天 连续签到: 4 天 [LV.9]测试副司令
|
1测试积点
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
复制代码
|
|