title: Receiving null value in POST param
body: <p>I receive a null value always in web api rest post request to a controller</p>
  
  <p>In my controller</p>
  
  <pre><code>[HttpPost]
  public HttpResponseMessage PostCustomer([FromBody]Customer customer)
  {
  
         System.Diagnostics.Debug.WriteLine(customer); #CustomerApp.Models.Customer
         System.Diagnostics.Debug.WriteLine(customer.FirstName); #null
  
  }
  </code></pre>
  
  <p>Model</p>
  
  <pre><code>public class Customer
  {
      public int Id { get; set; }
      public string LastName { get; set; }
      public string FirstName { get; set; }
  }
  </code></pre>
  
  <p>Request:</p>
  
  <pre><code>POST: http://localhost:21894/api/customer/postcustomer
  
  Content-Type: application/json
  
  body: {FirstName: "xxxx", LastName: 'yyyy'}
  </code></pre>
  
  <p>I tried the following solutions but nothing works out</p>
  
  <p><a href="https://myadventuresincoding.wordpress.com/2012/06/19/c-supporting-textplain-in-an-mvc-4-rc-web-api-application/" rel="nofollow noreferrer">https://myadventuresincoding.wordpress.com/2012/06/19/c-supporting-textplain-in-an-mvc-4-rc-web-api-application/</a></p>
  
  <p><a href="https://stackoverflow.com/questions/17832784/how-to-get-post-data-in-webapi">How to get POST data in WebAPI?</a></p>
  
  <p>Can anybody guide me with help or the correct link</p>
  
  <p><strong>Answer:</strong>
  Made a curl request instead of dealing with postman as like this gave me the solution </p>
  
  <pre><code>$ curl -H "Content-Type: application/json" -X POST -d '{"FirstName":"Jefferson","LastName":"sampaul"}' http://localhost
  :21894/api/customer/postcustomer
  </code></pre>