I am trying to write code in JavaScript that will allow me to send an HTTPS command to an IP phone.
I have code that works for HTTP:
url = "http://123.456.789.101/cgi-bin/api-send_key";
if (url != "") {
var params = "passcode=admin&keys=" + withcolon + "SEND";
var http = new XMLHttpRequest();
http.open("GET", url + "?" + params, true);
http.onreadystatechange = function () {
if (http.readyState == 4 && http.status == 200) {
alert(http.responseText);
}
}
http.send(null);
}
Again, this code works. However, I'd like to send it out via an HTTPS message. What changes can be made to accomplish this?