1
Hello,
I’m having trouble making a post for the github api, I get this error in Mozilla:
Blocked cross-origin request: Same Origin Policy (Same Origin Policy) prevents reading the remote resource at https://api.github.com/repos/marcobrito/frontEnd/issues. (Reason: 'access-control-allow-origin' symbol missing in CORS header 'Access-Control-Allow-Headers' during CORS pre-connection).
And in Chrome:
https://api.github.com/repos/marcobrito/frontEnd/issues 401 (Unauthorized)
Just 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 someone help me?