我只想通過REST API通過瀏覽器(IE11,Firefox,Chrome)中的本地JavaScript寫入ALM,但無法登錄。 我試圖使用How to access HP ALM using REST and local javascript?所示的代碼,但總是有相同的錯誤:OPTIONS https://alm.....net/qcbin/authentication-point/authenticate 401(認證對象未在SecurityContext中找到)如何使用rest api訪問hp alm javascript:自動登錄
也許問題是,我不知道該怎麼
submit my credentials via XML
正如鏈接中所述。你可以幫我嗎?
我的代碼是:
function signinTest() {var auth = btoa(name + ":" + password);
$.ajax({
type: "POST",
url: 'https://alm.....net/qcbin/authentication-point/authenticate',
headers: {
"Authorization": "Basic " + auth
},
xhrFields: {
withCredentials: true
},
success: function (data) {
console.log("succes " + data);
},
error: function (data) {
console.log("error ");
console.log(data);
}
});
}