angularjs - Enabling CORS in an API gateway -
i making cordova application. need make simple request angular.
i keep getting message: "cross-origin request blocked: same origin policy disallows reading remote resource @ http://myserver/authenticateme. can fixed moving resource same domain or enabling cors."
i thought added necessary headers response. here full header:
"access-control-allow-headers: origin, x-requested-with, content-type, accept access-control-allow-origin: * content-encoding: gzip content-length: 76 content-type: application/json;charset=utf-8 date: mon, 16 mar 2015 21:37:56 gmt server: apache-coyote/1.1"
i tried in firefox , chrome.
this extremely annoying because never had problem server when doing native ios , android requests.
am missing here???
did try jsonp?
something like:
$http.jsonp(api_url + "/?callback=json_callback") .success(function(data) { // blah blah }) .error(function() { console.log("couldn't fetch."); }) .finally(function() { // blah blah });
Comments
Post a Comment