Search Posts

Category: pingdom

Angularjs Pingdom API CORS

I’ve a angularjs aplication that need access Pingdom API, when I do request using Postman all work fine, but when I use AngularJs $http service doesn’t work. My http request: $http.get(url).then( function (response) { deferred.resolve(response); }, function (err) { deferred.reject(err); } ); output: XMLHttpRequest cannot load https://api.pingdom.com/api/2.0/checks/xxxxxxx. Response for preflight has invalid HTTP status code 401 Common request config: $httpProvider.defaults.headers.post = {}; $httpProvider.defaults.headers.put = {}; $httpProvider.defaults.headers.patch = {}; $httpProvider.defaults.headers.delete = {}; $httpProvider.defaults.headers.common[‘content-type’] = “application/json”; $httpProvider.defaults.headers.common[‘authorization’] […]