如果錯(cuò)誤代碼為摘要身份驗(yàn)證的401,我嘗試從http響應(yīng)中獲取標(biāo)頭。這是我的代碼: this.http.post(this.hostname + ':10000/users/auth2', { })
.subscribe(res => {
console.log(res);
},
error => {
console.log(error);
});如果發(fā)布請(qǐng)求返回200代碼,一切正常。如果我從后端返回401代碼,則無(wú)法訪(fǎng)問(wèn)標(biāo)頭。chrome調(diào)試器顯示標(biāo)題。郵差調(diào)用也可以使用digest auth工作。
如何在角度中獲得響應(yīng)標(biāo)題
紫衣仙女
2019-04-25 14:15:51