【发布时间】:2015-05-15 00:03:39
【问题描述】:
我正在尝试通过 $http.post 调用将授权标头传递给 .NET Web API 服务。
如果我使用这个:
$http.post(urls.getEmployeeInfo,
{
withCredentials: true,
headers:{ 'Authorization': 'Basic ' + btoa(username + ":" + password)}
}
);
授权标头未发送到我的服务。
以下作品:
$http({
url: urls.getEmployeeInfo,
method: "POST",
withCredentials: true,
headers: {
'Authorization': 'Basic ' + btoa(username + ":" + password)
}
});
为什么 $http.post 不发送 Authorization Header ?
谢谢
【问题讨论】:
标签: angularjs