title: Angular restAPI call to java returns 400 error
body: <p>I am trying to call the hibernate restapi through the angularjs but it returns 400 error , but when I am making the call through post man it returns the value,
  my code as follwos</p>
  
  <p><strong>java code</strong></p>
  
  <pre><code>@RequestMapping(value = "/sample.html", method = RequestMethod.POST)
  @ResponseBody
  public static Response getCustomerDetails(@RequestParam("userId")Long userId, 
                                                @RequestParam("itemId")ArrayList&lt;Long&gt; itemId)  throws AViewException
  {
      customerDetails=new object({"customerName":xxx});
      return Response.status(Status.OK).entity(customerDetails).build();
  }
  </code></pre>
  
  <p><strong>angularjs</strong></p>
  
  <pre><code>var itemId=[374,375,376,377];
  $scope.selected ={
              userId:$rootScope.user.userId,
              itemId:itemId
          };
  console.log($scope.selected);       
  $http({ method: 'POST',
      url: 'http://10.3.2.204:8080/aview/sample.html',                        
      headers: {
              'Authorization': 'Basic dGVzdDp0ZXN0',
              'Content-Type': undefined,
              'Accept': '*/*'},                       
      data: JSON.stringify($scope.selected)
  
  })
  .success(function(data, status, headers, config) 
  {   
      console.log(data);
       $scope.data = data;
       console.log($scope.data);
  
  })
  .error(function(data, status, headers, config) 
  {
      alert("error"); 
      console.log(data);                                  
  });
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <pre><code>HTTP Status 400 -
  
  type Status report
  
  message
  
  description The request sent by the client was syntactically incorrect.
  Apache Tomcat/7.0.41
  </code></pre>