title: Post data from Knockout to Controller using Ajax
body: <p>I'm getting null for the controller parameter. I am posting data as I can see it in Chrome Developer tools. I have a Person model in MVC that matches the Person model below. This is my ViewModel :</p>
  
  <pre><code> function Person(data) {
      this.FirstName = ko.observable(data.FirstName);
      this.LastName = ko.observable(data.LastName);
      this.Id = ko.observable(data.Id);
  
      this.fullName = ko.computed(function () {
          return this.FirstName() + " " + this.LastName();
      }, this);
  
  }
  
  function PersonViewModel() {
      var self = this;
      self.people = ko.observableArray([]);
  
  
  
      $.getJSON("/api/person/getpeople", function (allData) {
          var mappedTasks = $.map(allData, function (item) { return new Person(item) });
          self.people(mappedTasks);
      });
  
  
      self.save = function(){
  
          $.ajax("/api/person/updateperson", {
              data: ko.toJSON({ people: self.people }),
              type: "post", contentType: "application/json",
              success: function (result) { alert(result) }
          });
      }
  }
  ko.applyBindings(new PersonViewModel);
  </code></pre>
  
  <p>API controller:</p>
  
  <pre><code>  [HttpPost]
      public bool UpdatePerson(List&lt;Person&gt; person)
      {
          return mgr.UpdatePerson(person);
      }
  </code></pre>