title: ASP.NET Web API post method parameter is always null
body: <p>This is my models class:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  
  namespace Test.Models
  {
      public class User
      {
          public int Id { get; set; }
          public string Name { get; set; }
          //public DateTime startTime { get; set; }
          //public DateTime endTime { get; set; }
          //public int Age { get; set; }
          //public string Adress { get; set; }
      }
  }
  </code></pre>
  
  <p>This is my controller class:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Net;
  using System.Net.Http;
  using System.Web.Http;
  using Test.DBA;
  using Test.Models;
  
  namespace Test.Controllers
  {
      public class UserAPIController : ApiController
      {
          ApiDbContext dbContext = null;
          public UserAPIController()
          {
              dbContext = new ApiDbContext();
          }
          [HttpPost]
          public IHttpActionResult InsertUser(User user)
          {
              dbContext.Users.Add(user);
              dbContext.SaveChangesAsync();
  
              return Ok(user.Name);
          }
  
          public IEnumerable&lt;User&gt; GetAllUser()
          {
              var list = dbContext.Users.ToList();
              return list;
          }
  
          [HttpPost]
          public IHttpActionResult DeleteUser(User user)
          {
              dbContext.Users.Remove(user);
              dbContext.SaveChanges();
  
              return Ok(user.Name);
          }
  
          [HttpGet]
          public IHttpActionResult ViewUser(int id)
          {
              var student = dbContext.Users.Find(id);
              return Ok(student);
          }
  
          [HttpPost]
          public IHttpActionResult UpdateUser(User user)
          {
              User std = dbContext.Users.Find(user.Id);
  
              std.Name = user.Name;
              //std.startTime = user.startTime;
              //std.endTime = user.endTime;
              //std.Age = user.Age;
              //std.Adress = user.Adress;
  
              dbContext.Entry(std).State = System.Data.Entity.EntityState.Modified;
              dbContext.SaveChangesAsync();
  
              return Ok();
          }
      }
  }
  </code></pre>
  
  <p>I'm trying to call the post method with the google chrome app Postman. I call it with raw JSON body:</p>
  
  <pre><code>{
      Id : 1,
      Name : "Sample"
  }
  </code></pre>
  
  <p>The get methods work, but when i debug post methods the parameters are always null.</p>
  
  <p>Edit 1: Routing:</p>
  
  <pre><code>config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{action}/{id}",
                defaults: new { id = RouteParameter.Optional }
            );
  </code></pre>