title: how to send array of object in ajax post request asp.net core mvc razor
body: <p>I am trying to send array of object to web Api post ActionResult method</p>
  
  <p><strong>my array of objects looks like this</strong></p>
  
  <pre><code>model:[{"Status":"HOLD","MessageId":1},{"Status":"HOLD","MessageId":2}]
  </code></pre>
  
  <p><strong>post request from front-end in .cshtml file</strong></p>
  
  <pre><code>    $.ajax({
          method: 'post',
          url: "Home/postMessage",
          data: JSON.stringify(model),
          contentType: "application/json; charset=utf-8",
          dataType: "json",
          success: function (data) {
             console.log(data)
          }
      });
  </code></pre>
  
  <p><strong>web api code looks like this</strong></p>
  
  <p><strong>PostStatus model</strong></p>
  
  <pre><code>public class PostStatus
      {
          public string Status { get; set; }
  
          public int MessageId { get; set; }
      }
  </code></pre>
  
  <p><strong>post Request code in controller</strong></p>
  
  <pre><code>[HttpPost]
  public ActionResult postMessage(PostStatus model)
  {
      return  Json(new { data = model });
  }
  </code></pre>
  
  <p>debugging snip of above web api post request code</p>
  
  <p><a href="https://i.stack.imgur.com/sUvvH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sUvvH.png" alt="enter image description here"></a></p>
  
  <p>I WAS UNABLE FIND THE ISSUE WHERE IT WAS CAUSING THE PROBLEM.</p>