CORs for Ionic ? Error for $http.post


#1

I am trying to do a $http.post to my server. However , i keep getting errors regarding "“Access-Control-Allow-Origin” being missing despite already adding it to my backend.

Instead when i try to do a $http.get , adding “Access-Control-Allow-Origin” header to my backend helped solved the error. However with $http.post, its as if the decleration of the header is entirely ignored.

My question is do i need to add headers to my Ionic Side as well ? And if so, how can i go upon doing that? Thank you


#2

Are you trying to post from localhost to external ip? or localhost to localhost ?


#3

i am trying localhost to localhost