json - Getting 404 error on POST. Angular.js -
new angular , javascript. using angular connect service on different server. able data fine, when trying post, 404. tried follow angular documentation closely possible. doing wrong?
ps. have sniffed traffic, , noticed post hex empty. stumped.
edit: heres error(s) getting in console. options http://url 404 (not found) angular.js:7997<br> options http://url invalid http status code 404 angular.js:7997<br> xmlhttprequest cannot load http://url. invalid http status code 404 app.controller('sendcontroller', ['$scope', 'request', function($scope, request) { $scope.request = { // test data here }; $scope.send = function() { request.save($scope.request); }; }]); app.factory('request', ['$resource', function($resource) { return $resource(url); }]);
it looks on server side configuration. had set access-control-allow-origin *. according answer below, chrome no longer supports that.
original (wrong):
header("access-control-allow-headers: *"); corrected:
header("access-control-allow-headers: origin, x-requested-with, content-type, accept"); for more information check out post. https://stackoverflow.com/a/18192705/3010896
Comments
Post a Comment