I wrote an ASP Script to generate JSON data/string. How do i send that data to a web service? I was given the info below, and i do not have access to the server to register any dll files. I did some searching and saw that i should be using XMLHttpRequest but not sure how to do that.
Please help. Thank you.
Connecting to the web service The web service works over the HTTP protocol. It is recommended that this web service, once in production, use a Secure Socket Layer (HTTPS). The web service is designed to work with the URL: http://thedomain.com/api/push
The site uses an authentication token in the header to prevent crawlers from interfering with the web service. When sending data add a header called HTTP_TOKENKEY with the value of ABCDEFGHIJKL. This is one reason why HTTPS is recommended. The web service will look for JSON data in the request’s POST and sends JSON responses back to the client.
This is what i have so far
strJSONToSend = theevent
webserviceurl = "http://thedomain.com/api/push"
Set objRequest = Server.createobject("MSXML2.XMLHTTP.3.0")
objRequest.open "POST", webserviceurl, False
objRequest.setRequestHeader "Content-Type", "application/json; charset=UTF-8"
objRequest.setRequestHeader "HTTP_TOKENKEY","ABCDEFGHIJKLMNOPQ"
objRequest.setRequestHeader "SOAPAction", webserviceurl
results = objRequest.send (strJSONToSend)
write (results)
set objJSONDoc = nothing
set objResult = nothing
this freezes up and does nothing