title: Posting json data to WebAPI method in angularjs
body: <pre><code>$scope.items = {2: true, 4: true, 5: true, 7: true, 9: true, 10: true, 11: true };
  </code></pre>
  
  <p>How do I post the above json data to the following WebAPI method using angularjs's $http?</p>
  
  <pre><code>[Authorize]
  [HttpPost]
  [Route("moveemployees")]
  public HttpResponseMessage MoveEmployees(Dictionary&lt;decimal, bool&gt; employeeList)     
      {
           // employeeList doesn't contain any items after the post
           return Request.CreateResponse(HttpStatusCode.OK);
      }
  </code></pre>
  
  <p>I tried :</p>
  
  <pre><code>$http({
          method: 'POST',
          cache: false,
          url: $scope.appPath + 'Employee/moveemployees',
          data: { employeeList : $scope.items },
          headers: {
              'Content-Type': 'application/json; charset=utf-8'
             }
          }).success(function (data, status) {
              $scope.infos.push('Employees Moved Successfully');
              $scope.errors = [];
          }).error(function (data, status) {                
       });
  </code></pre>
  
  <p>What's wrong with my code?</p>