Attempting to do a WinHTTP request to submit form. One of the request body items is called 'StartDateTime' and when I view the request body in developer tools - I see it is sending " StartDateTime='03/04/2020 00:00:00' "
However, when I attempt to do this via VBA - I receive the the response: {"Data":null,"ModelState":{"Valid":false,"Message":"Error# 1 - Missing input parameter [ StartDateTime ]...
I have tried multiple attempts at reformatting the request body with no luck - including a direct copy/paste of the entire request body from developer tools
Dim XMLHttp As WinHttpRequest: Set XMLHttp = New WinHttpRequest
XMLHttp.Open "POST", URL, False
XMLHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
XMLHttp.send "StartDateTime='03/04/2020 00:00:00'"
Debug.Print XMLHttp.responseText
Set XMLHttp = Nothing
What am I doing wrong here?