I am trying to connect to our MSE install via AJAX. I can connect and get results for a call via the Chrome REST plugin just fine. But via AJAX i get authentication issues. Any advice? Below is my code with fake IP and user:pass...
var url = 'https://myip/api/contextaware/v1/maps/count'; // just calling a simple call directly
var auth = 'Basic 12345abcdef';
$.ajax({
url : url,
method : 'GET',
beforeSend : function(req) {
req.setRequestHeader('Authorization', auth);
},
success: function(response){
alert('Yes');
},
error: function (request, status, error) {
alert('No');
}
});
Result: 401 Not Authorized