title: JQuery ajax POST string parameter, MVC action method get null
body: <p>I have seen quite a few posts online regarding this kind of problem and tried different approach, e.g. JSON.stringify the parameter, but none of them works on mine case. </p>
  
  <p>I thought it should be a really simple and straight forward coding experience. But couldn't figure out what I did wrong.</p>
  
  <p>Here is my JQuery code:</p>
  
  <pre><code>$(document).ready(function () {
      $('#SendEmails').click(function () {
          var emails = $("#EmailList").val();     
  
          $.ajax({
              url: '/Requests/SendEmails',
              type: "POST",
              data: { 'emails': emails },
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              success: function (response) {
                  alert(response.responseText);
              },
              error: function (response) {
                  alert(response.responseText);
              },
              failure: function (response) {
                  alert(response.responseText);
              }
          })
      })
  })
  </code></pre>
  
  <p>And my action method is like:</p>
  
  <pre><code>[HttpPost]
  public string SendEmails(string emails)
  {
      return "Good";
  }
  </code></pre>
  
  <p>I always get null in action method when I debug the code.</p>
  
  <p>But if I change the url to this:</p>
  
  <pre><code>url: '/Requests/SendEmails?emails=' + emails,
  </code></pre>
  
  <p>and remove </p>
  
  <pre><code>data: { 'emails': emails },
  </code></pre>
  
  <p>it will work.</p>
  
  <p>Anyone could point me what is wrong with the original code? I don't think .Net Core 2.x should make any difference right?</p>
  
  <p>Thank you.</p>