See by default, jQuery passes data using Content-Type: x-www-form-urlencoded and the familiar serialization foo=bar&baz=moe . However, AngularJS passes data using Content-Type: application/json and { "foo": "bar", "baz": "moe" } JSON serialization , unfortunately, some web server languages, especially PHP, are not separated from zero .
so that you can do this when you define your angular module:
angular.module('MyModule', [], function($httpProvider) { // Use x-www-form-urlencoded Content-Type $httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8'; });
The answer from this message is from Felipe Myoso .
source share