title: Cannot post json to controller using ajax in asp.net core
body: <p>I have the following code</p>
  
  <p><strong>Controller Action Method</strong></p>
  
  <pre><code>    [HttpPost]
      public async Task&lt;IActionResult&gt; Approve(int[] ids)
      {
          await _service.Approve(ids).ConfigureAwait(false);
          return Json("Success.");
      }
  </code></pre>
  
  <p>On client side i have the following to Post data</p>
  
  <pre><code>var data = JSON.stringify(getIDs())
  
     $.ajax({
          type: "POST",
          data: data,
          url: "approve",
          contentType: "application/json; charset=utf-8",
          processData: true,
          cache: false,
          })
          .done(function (response, textStatus, jqXHR) {
              // do something here
          })
          .fail(function (jqXHR, textStatus, errorThrown) {
              // do something here
          })
  
   function getIDs() {
          var keys = [];
           keys.push(1);
           keys.push(2);
           keys.push(3);
          return keys;
      }
  </code></pre>
  
  <p><strong>ISSUE</strong><br>
  On server, in approve action method the <code>ids</code> parameter is always empty.   </p>
  
  <p>I have also tried sending data as</p>
  
  <pre><code>var data = JSON.stringify({ids:getIDs()})
  </code></pre>
  
  <p>I am using ASP.NET Core with target framework 1.1. </p>
  
  <p>I have the same code in classic asp.net and it works</p>