I wrote ASP Script to generate JSON data / string. How to send this data to a web service? I was provided with the information below, and I do not have access to the server to register any DLL files. I did some searches and saw that I should use XMLHttpRequest, but I donβt know how to do it.
Please, help. Thanks.
Connecting to the web service The web service runs over HTTP. It is recommended that this web service, once in production, use the 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 discourage crawlers from using the web service. When sending data, add a header named HTTP_TOKENKEY with the value ABCDEFGHIJKL. This is one of the reasons why HTTPS is recommended. The web service will look for JSON data in POST requests and send JSON responses back to the client.
This is what I still have
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
it freezes and does nothing
source share