I have sent cross domain POST request It needs authentication. By xhr
var xmlhttp = new XMLHttpRequest(),
method = 'POST',
url = 'http://192.168.1.54:7080/services/pdf/234';
xmlhttp.open(method, url, true, 'admin', 'admin');
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState !== XMLHttpRequest.DONE) {
return;
}
if (xmlhttp.status !== 200) {
return;
}
console.log(xmlhttp.responseText);
};
xmlhttp.send("fname=Henry&lname=Ford");
I have put Credentials with xmlhttp.open method, But still it open browser authentication popup.
I want to give post request with username and password to get response.