【发布时间】:2016-09-16 09:33:04
【问题描述】:
我正在尝试使用 angular 获取 Rest 服务:
angular.module('coursExoApp').factory('serviceAjax', function ($http) {
return{
objects: function(){
var test=$http({
method: 'GET',
url: 'http://------------/Windchill/servlet/rest/changes/objects/getReports',
headers: {
'Authorization': 'Basic d2NhZG1pbjp3Y2FkbWlu'
}
}).
success(function(data, status, headers, config) {
console.log('success');
}).
error(function(data, status, headers, config) {
console.log(config);
});
return test;
}
}});
我收到了这个错误: IMAGE HERE
具有基本身份验证的服务在 postMan 上运行良好。 感谢帮助
【问题讨论】: