AngularJS: Refused to set unsafe header “Access-Control-Request-Headers”
问题 I'm trying to call a REST API running locally using AngularJS. Here is the AngularJS code : $http.defaults.headers.common = {"Access-Control-Request-Headers": "accept, origin, authorization"}; $http.defaults.headers.common['Authorization'] = 'Basic amF5M2RlYzpqYXk='; $http({method: 'GET', url: 'http://127.0.0.1:5000/user/jay3dec'}). success(function(data, status, headers, config) { }). error(function(data, status, headers, config) { alert(data); }); But I'm getting an errors in the browser