resttesttest
resttesttest copied to clipboard
Adding CORS support
To be able to send from one domain to an other I added this:
myajax.crossDomain = true;
if (checkForAuth())
{
var username = $("#authentication input:first").val();
var password = $("#authentication input").eq(1).val();
myajax.beforeSend = function (xhr) {
xhr.setRequestHeader ("Authorization", "Basic " + btoa(username+":"+password));
};
}
in the debug.js instead of this:
if (checkForAuth())
{
myajax.username = $("#authentication input:first").val();
myajax.password = $("#authentication input").eq(1).val();
}