title: Unable to create new item in Sharepoint 2013 List
body: <p>I am trying to save an item to SharePoint's list using knockout js and REST. In my Ajax POST I have used ko.toJSON. I tried using JSON.stringify but I can't see the entry in SharePoint List. I maybe passing the wrong parameter value. 
  Thanks in advance.</p>
  
  <p>My HTML:</p>
  
  <pre><code>&lt;link rel="Stylesheet" href="/css/default.css" /&gt;
  
  &lt;script type="text/javascript" src="/js/knockout-3.4.2.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="/js/jquery-3.2.1.min.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript" src="/js/o.min.js"&gt;&lt;/script&gt;
  
  &lt;form id="form1" runat="server"&gt; 
  &lt;div class="style1"&gt; 
  &lt;div class="codeRunner"&gt;&lt;br/&gt;
  
  
  &lt;h3&gt;Tasks&lt;/h3&gt;
  
  
  &lt;form data-bind="submit: addTask"&gt;
      Add task: &lt;input data-bind="value: newTaskText" placeholder="What needs to be done?" /&gt;
      &lt;button type="submit"&gt;Add&lt;/button&gt;
  &lt;/form&gt;
  
  &lt;ul data-bind="foreach: tasks, visible: tasks().length &gt; 0"&gt;
      &lt;li&gt;
          &lt;input type="checkbox" data-bind="checked: isDone" /&gt;
          &lt;input data-bind="value: title, disable: isDone" /&gt;
          &lt;a href="#" data-bind="click: $parent.removeTask"&gt;Delete&lt;/a&gt;
      &lt;/li&gt; 
  &lt;/ul&gt;
  
  You have &lt;b data-bind="text: incompleteTasks().length"&gt;&amp;nbsp;&lt;/b&gt; incomplete task(s)
  &lt;span data-bind="visible: incompleteTasks().length == 0"&gt; - it's water time!&lt;/span&gt;
  
  &lt;br/&gt;
  &lt;button data-bind="click: save"&gt;Save&lt;/button&gt;
  
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>My JS:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  var sharepointBaseUrl = "/trp/";
  var sharepointTaskListUrl = sharepointBaseUrl + "_api/lists/getbytitle('Test2')";
  
  
  
  function Task(sharepointItem) {
      var self = this;
  
      self.id = sharepointItem.ID;
  
      self.title = ko.observable(sharepointItem.Title);
      self.isDone = ko.observable(sharepointItem.IsDone);
  }
  
  
  
  function TaskListViewModel() {
      // Data
      var self = this;
      self.tasks = ko.observableArray([]);
      self.newTaskText = ko.observable();
      self.incompleteTasks = ko.computed( function() { return ko.utils.arrayFilter(self.tasks(), function(task) { return !task.isDone() }); });
  
      // Operations
      self.addTask = function() {
          self.tasks.push(new Task({ Title: this.newTaskText() }));
          self.newTaskText("");
          var itemType="SP.Data.Test2ListItem";
          var addedItems=ko.toJSON({
              __metadata: itemType,
              'Title': self.newTaskText()
          });
  
          $.ajax({
              url: sharepointTaskListUrl + "/items", 
              type: "POST",
              headers: {
                  "accept": "application/json;odata=verbose",
                  "X-RequestDigest": $("#__REQUESTDIGEST").val(),
                  "content-Type": "application/json;odata=verbose"
              },
              data: addedItems,
              success: function (data) {
                  console.log(data);
              },
              error: function (error) {
                  alert(JSON.stringify(error));
              }
          });
  
  
      };
      self.removeTask = function(task) { self.tasks.remove(task) };
  
  
  
      //load from SP List
      $.ajax( {
              url: sharepointTaskListUrl + "/items", 
              method: "GET",
              headers: { "Accept": "application/json; odata=verbose" },
              success: function (data) 
                       {
                           var items = data.d.results;
                           items.forEach( function(item) { self.tasks.push(new Task(item)); } );
                       },
              error: function (data) { alert("ERROR: " + data) }
       } );
  
  
  
  
  }
  
  ko.applyBindings(new TaskListViewModel());
  
  
  &lt;/script&gt;
  </code></pre>