Nodejs plus angularjs report an error when writing a post request.

  node.js, question

Front-end controller code:

userAction.controller('login', function($scope, $http){
 $scope.formData={};
 $scope.processForm = function(){
 console.log($.param($scope.formData))
 /*var obj = {
 username: $scope.formData.username,
 password: $scope.formData.password
 }*/
 $http({
 url: '/login',
 method: 'post',
 data: $.param($scope.formData),
 header: ("Content-Type", "application/x-www-form-urlencoded")
 })
 .success(function(data){
 console.log(data);
 })
 bracket
 });

The error reported at this time is as follows:

clipboard.png

If the transmitted data uses obj object in Figure 1, no error will be reported. May I ask Why is this?

It is estimated that the parameter type is wrong. Look at this:Problems and Solutions Encountered in Building Applications with AngularJS (Version 1.3.9)