0
我試圖讓Ajax調用如下:AjaxCall的jQuery的
$.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);
}
});
,但我得到了以下錯誤:
Failed to load resource: the server responded with a status of 401()
我缺少的東西? (端點上的身份驗證是HTTPBasicAuthorization)
你不需要http:// localhost:8080 /,你應該只需要/ projects/1爲你的url – Keith