title: Asp.net core MVC post parameter always null
body: <p>I am new to MVC core.</p>
  
  <p>I have created a project with MVC core which has a controller. This controller has Get and Post action methods. If i pass data to Get method using query string it works fine, but when i pass complex JSON to post method, then it always shows me null.</p>
  
  <p>Here what i am doing:</p>
  
  <p><strong>Post Request</strong></p>
  
  <pre><code>URL: http://localhost:1001/api/users
  Content-Type: application/json
  Body: 
  {
     "Name":"UserName",
     "Gender":"Gender of the user",
     "PhoneNumber":"PhoneNumber of the user"
  }
  </code></pre>
  
  <p><strong>Here is the Post action method</strong></p>
  
  <pre><code>[HttpPost]
  [Route("api/users")]
  public async Task&lt;IActionResult&gt; Post([FromBody]User newUser)
  {
     ...
  }
  </code></pre>
  
  <p>When post request is called, then <strong>newUser</strong> always shows me null. And if i remove <strong>[FromBody]</strong> attribute then i receive newUser object but all of its fields are null.</p>
  
  <p>Please help me and guide me in this issue.</p>
  
  <p><strong>EDITED</strong></p>
  
  <p>Here is my <strong>User</strong> class</p>
  
  <pre><code>public class User{
  
     public int Id { get; set; }
     public string Name { get; set; }
     public string Gender { get; set; }
     public string PhoneNumber { get; set; }
  }
  </code></pre>
  
  <p>I had done same as described <a href="https://lbadri.wordpress.com/2014/11/23/web-api-model-binding-in-asp-net-mvc-6-asp-net-5/">here</a> for json data, but still receives null. </p>