I am working on making a report for my company that takes values from a GET API request and cross compares received values against values received from elsewhere. The problem I am facing is that the GET request works perfectly on Postman but returns response as though the body I am attaching is not reaching the server when I send the same request through VBA. The body attached with the request is needed to indicate from which date to which date and other details needed by the server to filter the response and without it the response is identical to what I am receiving now, so I am fairly certain this is the issue but I don't know how to force VBA to send the body along with a GET request.
JsonAddBody = Digi.Cells(1, 27).Value
Debug.Print JsonAddBody
'{"tenantId": "100002","startDate":"2021-08-22","endDate":"2021-08-23"}
JsonAddBodyLen = Digi.Cells(2, 27).Value
Debug.Print JsonAddBodyLen
'______________________________________________________________
'URL and other settings for HTTP request
Url = "http://rms.digitory.com:300/Details"
Set hReq = CreateObject("MSXML2.XMLHTTP")
With hReq
.Open "GET", Url, False
.setRequestHeader "Authorization", "Bearer " & authKey
.setRequestHeader "User-Agent", "Mozilla 5.0"
.setRequestHeader "Accept", "application/json"
.setRequestHeader "Content-type", "application/json"
.setRequestHeader "Content-Length", "" & JsonAddBodyLen
.send (JsonAddBody)
End With