我正在尝试使用 Excel 中的 VBA 从一份报告中获取数据。
我收到此错误消息:
{"data":{"message":"不支持请求方法 'GET'","code":3000}}
这是我的代码:
Dim strUrl As String
strUrl = "https://api.clockify.me/api/workspaces/{workspaceId}/reports/{reportId}/"
Set hReq = CreateObject("MSXML2.XMLHTTP")
With hReq
.Open "GET", strUrl, False
.SetRequestHeader "X-api-key", "{api-key}"
.SetRequestHeader "content-type", "application/json"
.Send
End With
'wrap the response in a JSON root tag "data" to count returned objects
Dim response As String
response = "{""data"":" & hReq.ResponseText & "}"
Debug.Print response
为什么这里不允许使用 GET 方法?