I am trying to use the $http service on a HTTPS URL with the following code :
var request = $http.post('https://my.custom.url/webservice', privateAttributes.requestData);
request.success(function(data, status) {
}).error(function(data, status) {
console.log('data -', data);
console.log('status -', status);
});
The my.custom.url is on a different domain as my angularJS app, but my webserver is well configured to allow cross domain XHR request. It's supposed to be a public webservice.
When the request is sent, the promise is instantly rejected, so the error() function is triggered. The data is undefined and the status is 0.
On the network tab of my debugger in Chrome, I can see a pending OPTIONS request corresponding to my $http.post() call.
For testing purpose, I tried to do the same request with jQuery $.post() method and it worked with no issue. I think I am making something wrong with the $http service.
Please note that it's not a XSRF issue and if I use the HTTP version of my webservice, the request is a success.
Thanks for your help.