title: How can I send parameters in my http request using AngularJS?
body: <p>I am using the following code:</p>
  
  <pre><code>$http({
      method: 'GET',
      url: '/Admin/GetTestAccounts',
      data: { applicationId: 3 }
  }).success(function (result) {
      $scope.testAccounts = result;
  });
  </code></pre>
  
  <p>The code sends the following to my server:</p>
  
  <pre><code>http://127.0.0.1:81/Admin/GetTestAccounts
  </code></pre>
  
  <p>When this is received by my MVC controller:</p>
  
  <pre><code>[HttpGet]
  public virtual ActionResult GetTestAccounts(int applicationId)
  {
      var testAccounts =
          (
              from testAccount in this._testAccountService.GetTestAccounts(applicationId)
              select new
              {
                  Id = testAccount.TestAccountId,
                  Name = testAccount.Name
              }
          ).ToList();
  
      return Json(testAccounts, JsonRequestBehavior.AllowGet);
  }
  </code></pre>
  
  <p>It complains that there is no applicationId. </p>
  
  <blockquote>
    <p>The parameters dictionary contains a null entry for parameter 'applicationId' of non-nullable type 'System.Int32' for method</p>
  </blockquote>
  
  <p>Can someone explain why the applicationId is not being sent as a parameter? Previously I was doing this with the following non-Angular code and it worked just fine:</p>
  
  <pre><code>$.ajax({
      url: '/Admin/GetTestAccounts',
      data: { applicationId: 3 },
      type: 'GET',
      success: function (data) {
          eViewModel.testAccounts(data);
      }
  });
  </code></pre>