I am trying to post a simple JSON object to my local asp.net web.api service.
here is a peace of code.
createTable: function (table) {
var res = $http.post('http://localhost:50827/api/v0.1/xxxx/create-some-table', table);
res.success(function (data, status, headers, config) {
alert("Sent : " + JSON.stringify({ data: data }));
});
res.error(function (data, status, headers, config) {
alert("failure message: " + JSON.stringify({ data: data }));
});
}
Asp.Net Web Api has Cors enabled and this peace of code works well with internet explorer. But Google's Chrome leaves error: OPTIONS: http://localhost:50827/api/v0.1/xxxx/create-some-table 404 (Not Found)
Same webapi controller has some other GET methods and it works well.
Any idea?
Appreciate any help.
Pavlo