Angular.js, when accessing a web service using the $http object, automatically adds a X-Requested-With:XMLHttpRequest header to the request.
The web service I am accessing using CORS doesn’t support X-Requested-With header, so I tried to eliminate it but I can’t acess the $httpProvider object. I get an undefined object error, and if I reference it in the controllers parameters, so that angular injects it I get a “Error: Unknown provider: $httpProviderProvider <- $httpProvider”
So I wonder how can I access the $httpProvider, like it says in the docs (http://docs.angularjs.org/api/ng.$http) to tell angular.js not to send that header…
1 Answer