我正在尝试编写一个网络浏览器,以便我可以拨打Cisco 7942电话。我使用firefox不处理相同的源/域问题。我没有使用网络服务器,只是直接访问手机的浏览器页面。
我一直收到NS_ERROR_FAILURE:失败
如果我在浏览器页面中手动输入网址http://172.25.11.59/CGI/Execute
,我可以访问(只访问...不发送任何XML对象)手机...所以我不知道。
document.domain = "company.com";
var xml = new XMLHttpRequest();
xml.open("post", "http://172.25.11.59/CGI/Execute", false);
xml.setRequestHeader("Authorization", "Basic MTgyMjg6MTgyMjg=");
xml.setRequestHeader('Content-Type', 'text/xml');
xml.send('<CiscoIPPhoneExecute><ExecuteItem URL="Dial:2102263232" /></CiscoIPPhoneExecute>');
console.log(xml.status);
console.log(xml.responseText);
console.log("it ran")
答案 0 :(得分:0)
我发现思科手机仍在拒绝我。
答案 1 :(得分:0)
您的xml.send缺少'XML ='
'XML=<CiscoIPPhoneExecute><ExecuteItem URL="Dial:2102263232" /></CiscoIPPhoneExecute>'
您确定您的授权服务器返回'AUTHORIZED'吗?