Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Angularjs Post Request CORS issue

$
0
0

Nic, I know you said there should be no CORS issues but I don't know what else my problem could be and it's sooo frustrating ... I've been searching and searching I don't know what's going on.. I keep getting a status:0 error message with the following code:

$scope.feedlyApi = function() {

var req = {
	method: 'GET',
	url: "http://sandbox.feedly.com/v3/search/feeds",
	params: {
		'query': 'nursing'
	},
	headers: {
	      'Content-Type': 'application/json' ,
	       'Access-Control-Allow-Origin': '*',
	        'Access-Control-Allow-Methods': 'POST, GET, OPTIONS',
	      'Access-Control-Allow-Headers':'X-Requested-With'
	 }
}

$http(req).success(function(res) {
	console.log(res);
	console.log('Success', angular.toJson(res.data));
}).error(function(err){
	console.error(angular.toJson(err))
})

}

I added the chrome plugin to enable CORS and the API request is successful when i use ionic serve however when i run ionic emulate --live reload I can't get it to work


Viewing all articles
Browse latest Browse all 228595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>