I am basically a noob in classic ASP and VBScript, so I would like to get some help to achieve the goal I have here. I've built a JSON string and I need to send it to a RESTful web service using VBScript. How do I do that?
I have some code, but I don't think it works:
strJSONToSend = JSONstr 'this is where I use my built JSON string
webserviceurl = "url here"
Set objRequest = Server.createobject("MSXML2.XMLHTTP.3.0")
objRequest.open "POST", webserviceurl, False
objRequest.setRequestHeader "Content-Type", "application/json; charset=UTF-8"
objRequest.setRequestHeader "CharSet", "utf-8"
objRequest.setRequestHeader "SOAPAction", webserviceurl
Set objJSONDoc = Server.createobject("MSXML2.DOMDocument.3.0")
objJSONDoc.loadXml strJSONToSend
objRequest.send objJSONDoc
set objJSONDoc = nothing
set objResult = nothing