Hello,
I'm having trouble getting a post to github's api, I get this error in mozilla:
Blocked cross-origin request: Same Origin Policy prevents the remote resource from being read at link . (Reason: 'access-control-allow-origin' symbol missing in the CORS 'Access-Control-Allow-Headers' header during CORS pre-connection).
And in Chrome:
link 401 (Unauthorized)
Follow my code:
myApp.controller('postCtrl', function($scope, $http){
$scope.form = {};
$scope.submitForm = function() {
$http({
method : 'POST',
url : 'https://api.github.com/repos/marcobrito/frontEnd/issues',
data : $scope.form, //forms user object
headers : {'Content-Type': 'application/x-www-form-urlencoded', 'Authorization': '094a87044657ca7859dd9b151a08d53ae4a0bad2', 'Access-Control-Allow-Origin': '*', 'Status': '203'}
})
.success(function(data) {
if (data.errors) {
} else {
console.log(errors)
}
});
};
});
Can anyone help me?