Hey there, I'm encountering a strange issue while trying to call my backend using the POST method.
Remote Address:192.168.58.183:80 Request URL:http://192.168.58.183/ESService/ESService.svc/CreateNewAccount Request Method:OPTIONS Status Code:405 Method Not Allowed Request Headersview source Accept:*/* Accept-Encoding:gzip, deflate, sdch Accept-Language:en-US,en;q=0.8,pl;q=0.6 Access-Control-Request-Headers:accept, content-type Access-Control-Request-Method:POST Connection:keep-alive Host:192.168.58.183 Origin:http://localhost:8100 Referer:http://localhost:8100/ User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) > AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.93 Safari/537.36 Response Headersview source Access-Control-Allow-Headers:Content-Type, Accept Access-Control-Allow-Methods:POST,GET,OPTIONS Access-Control-Allow-Origin:* Access-Control-Max-Age:1728000 Allow:POST Content-Length:1565 Content-Type:text/html; charset=UTF-8 Date:Mon, 02 Feb 2015 09:11:17 GMT Server:Microsoft-IIS/7.5 X-Powered-By:ASP.NET
I've included my code here - can someone please review it and let me know if everything seems correct?
$scope.RegisterUser = function(){
var us = {
UserName:$scope.userName,
Password:$scope.password,
UserRoleID:null,
Company:$scope.company,
Terms:$scope.terms,
ID:null,
BuyerID:app.buyerId
};
$http({method:'POST', url:app.wcf + '/CreateNewAccount', data:{us:us}})
.then(
function(resp){
app.Logger(resp.data);
},
function(err){
app.Logger(err);
})};
It's possible that I'm missing something or need to include additional configs for the http request. Any advice would be appreciated!