嗨,我正在调用 API 并使用 winhttp 请求和 GET 方法。我在 send 方法中传递了一个 json 样式参数,但它无法被接受。我最终得到错误消息:
{"code":"INS03","description":"需要事件 ID","requestId":"_181603230829162847306080","data":{},"validationErrors":null}
这看起来很奇怪,因为我确实传递了事件 id 参数,如下所示:
inventory_URL = "https://api.stubhub.com/search/inventory/v1"
Dim oRequest As WinHttp.WinHttpRequest
Dim sResult As String
Set oRequest = New WinHttp.WinHttpRequest
With oRequest
.Open "GET", inventory_URL, True
.setRequestHeader "Authorization", "Bearer " & access_token
.setRequestHeader "Accept", "application/json"
.setRequestHeader "Accept-Encoding", "application/json"
.send ("{""eventid"":""9445148""}")
.waitForResponse
sResult = .responseText
Debug.Print sResult
sResult = oRequest.Status
Debug.Print sResult
End With
我的代码有问题吗?
先感谢您,
瓦迪姆