Exit to the limb here, since you did not consider it necessary to include the actual error message. Most likely, you will get an “invalid character” error on line 3. This is because you need to define your JSON string as the actual string.
Change this:
strJSONToSend = {"type": "note", "title": "Alert", "body": "Lorem Ipsum Lorem Ipsum Lorem Ipsum."}
in it:
strJSONToSend = "{""type"": ""note"", ""title"": ""Alert"", ""body"": ""Lorem Ipsum Lorem Ipsum Lorem Ipsum.""}"
Edit: As a note, if you use On Error Resume Next
in your code, always set the correct error handling in place, and also keep it as localized as possible:
On Error Resume Next 'enable error handling objXmlHttpMain.open "POST",URL, False If Err Then 'handle errors WScript.Echo Err.Description & " [0x" & Hex(Err.Number) & "]" WScript.Quit 1 End If On Error Goto 0 'disable error handling again
source share