title: POST data using AngularJS
body: <p>I have following html page :</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
  &lt;head&gt;
    &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js"&gt;&lt;/script&gt;
    &lt;script src="scriptAssign.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body ng-app="myapp"&gt;
  
    &lt;div ng-controller="MyController"&gt;
      &lt;form ng-submit="submitForm()" method="POST"&gt;
        ATTID :
        &lt;input type="text" name="firstName" ng-model="myForm.firstName"&gt;
        &lt;br/&gt; Role :
        &lt;select ng-model="selectedRole" ng-options="myForm.roleName for myForm in role"&gt;&lt;/select&gt;
        &lt;br/&gt;
        &lt;input type="submit" id="submit" value="Submit" /&gt;
      &lt;/form&gt;
      &lt;div&gt;
        {{myForm.firstName}} {{selectedRole.roleName}}
      &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;script&gt;
    &lt;/script&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>My javascript file is as follows :</p>
  
  <pre><code>angular.module("myapp", [])
  .controller("MyController", ['$scope', '$http', function($scope, $http) {
      $scope.myForm = {};
      $scope.role = [{ roleName :"A"},{roleName : "B"},{ roleName : "C"}];
      $scope.submitForm = function() {
          $http.post('/services/poc/add').success(function(data) {
              $scope.myData = data;
          });
      }
  }]);
  </code></pre>
  
  <p>i am getting error as </p>
  
  <p><strong>HTTP Status 400 -
  type Status report message
  description The request sent by the client was syntactically incorrect.
  Apache Tomcat/7.0.32</strong></p>