title: How to POST Json object in JQuery's load method?
body: <p>I am using jQuery's load method to invoke controller action. However the controller not able to serialize the object.</p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>    [HttpPost]
      public ActionResult GetInformation(FilterModel[] filters)
      {
         // do something
      }
  </code></pre>
  
  <p><strong>Model</strong></p>
  
  <pre><code>public class FilterModel
  {
      public string Field { get; set; }
      public string Operator { get; set; }
      public string Value { get; set; }
  }
  </code></pre>
  
  <p><strong>Javascript</strong></p>
  
  <pre><code>$("#btnSave").click(function () {
      var data = [];
      data.push({
          field: 'field 1',
          operator: 'eq',
          value: '1'
      });
  
      data.push({
          field: 'field 2',
          operator: 'eq',
          value: '2'
      });       
  
      $('#mycontainer').load("Home/GetInformation", data, function (response)
      {
        // do something
      })
  </code></pre>
  
  <p>As per jQuery's documentation </p>
  
  <blockquote>
    <p>The POST method is used if data is provided as an object; otherwise,
    GET is assumed.</p>
  </blockquote>
  
  <p>So since i'm passing object, jquery is making POST request as expected however server is not able to serialize the object.</p>
  
  <p><strong>Note</strong>   </p>
  
  <p><strong>1></strong> If i change <code>GetInformation()</code> method to accept single filter(<em>instead of array</em>) like below</p>
  
  <pre><code>   [HttpPost]
     public ActionResult GetInformation(FilterModel filter)
     {
       // do something
     }
  </code></pre>
  
  <p>and then change JS script to send single instance of filter, then it works.   </p>
  
  <p><strong>2></strong> Also if I use jquery's <a href="http://api.jquery.com/jquery.ajax/" rel="nofollow noreferrer">$.ajax()</a> method directly to POST data (<em>instead of using load</em>) by setting proper content type then it works even with array parameter.</p>