I am trying to make an Ajax call as follows:
$.ajax({
type: "GET",
dataType: "json",
contentType: "application/json",
username: "user",
password: "admin",
url: "http://localhost:8080/projects/1",
xhrFields: {
withCredentials: true
},
success: function(data){
console.log(data);
}
});
But I get the following error:
Failed to load resource: the server responded with a status of 401 ()
Am I missing something? (Authentication on the endpoint is HTTPBasicAuthorization)