Error with $http post


#1

Hi There

I am getting the following error when doing an $http post.

Response for preflight has invalid HTTP status code 405
405 (Method Not Allowed)

The message returned from the server is as follows
{“message”:“The requested resource does not support http method ‘OPTIONS’.”}

I am able to post to the service using postman successfully so I am not sure why its not working from IONIC.

My Service

.service('Authentication', ['$http', function($http){

    var api_url = 'https://buygaloo.azurewebsites.net/api/Register';
    var ret = {
        register: function(data){
            return $http.post(api_url, data).then(function(resp){
                return resp.data;
            });
        }
    }
  
    
    return ret;

}]);

#2

A bit dated, but I found this SO solution: