title: AngularJS - $http.post keeps sending "NULL" values to ASP.NET Web API 2
body: <p>In simple terms, I'm making a task management tool with CRUD funcionality using AngularJS for the frontend and ASP.NET for the backend.</p>
  
  <p>In the ASP.NET I've created a table called "KBTM_Task" with the following parameters:</p>
  
  <pre><code>public class KBTM_Task
  {
      public int ID { get; set; }
      public string KBTM_Task_ID { get; set; } // this is an ID chosen by the user
      public string KBTM_Task_Title { get; set; }
      public string KBTM_Task_Description { get; set; }
  }
  </code></pre>
  
  <p>If I had rows to this table, either manually in Visual Studio or with Postman, then I can successfuly display these rows in a table in the frontend app using <code>$http.get</code>.</p>
  
  <p>The problem is when adding new rows within the app. I have a "New Task" button which takes the user to a form. What I want is for those values filled by the user to be stored in the database and then displayed in the table with the others.</p>
  
  <p>Here's my HTML code:</p>
  
  <pre><code>&lt;div class="form-group row"&gt;
      &lt;div class="col-xs-12 col-md-6"&gt;
          &lt;label for="Task_Title"&gt;Title&lt;/label&gt;
          &lt;input type="text" class="form-control" id="Task_Title" ng-model="tasks.title"&gt;
      &lt;/div&gt;
      &lt;div class="col-xs-6 col-md-3"&gt;
          &lt;label for="Task_ID"&gt;ID&lt;/label&gt;
          &lt;input type="text" class="form-control" id="Task_ID" ng-model="tasks.id"&gt;
      &lt;/div&gt;
      &lt;div class="col-xs-6 col-md-3"&gt;
          &lt;label for="Task_Description"&gt;Description&lt;/label&gt;
          &lt;textarea class="form-control" rows="3" id="Task_Description" ng-model="tasks.description"&gt;&lt;/textarea&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Here's the Angular code:</p>
  
  <pre><code>$scope.add = function (tasks)
  {
      if ($scope.tasks.title != null)
      {
          $scope.tasks.push
          ({
              'KBTM_Task_ID': $scope.tasks.id,
              'KBTM_Task_Title': $scope.tasks.title,
              'KBTM_Task_Description': $scope.tasks.description
          });
  
          var config = {
              headers : {
                  'Content-Type': 'application/x-www-form-urlencoded'
              }
          };
  
          $http.post('http://localhost/api/KBTM_Task', JSON.stringify($scope.tasks), config)
              .then(
                  function(response){
                      console.log(response.data)
                  }
              );
      }
  }
  </code></pre>
  
  <p><strong>The problem is that this adds a new row but with all the parameters "NULL".</strong> So it successfuly creates a new entry in the database but it doesn't send any of the values that I filled in the form.</p>
  
  <p>You can check my KBTM_TaskController (95% of it was automatically generated by Visual Studio) on this pastebin: <a href="http://pastebin.com/HRvgN7Jr" rel="nofollow">http://pastebin.com/HRvgN7Jr</a></p>
  
  <p>Please help me as I'm completely stuck. If you require more information, don't hesitate to ask. Thank you!</p>