title: curl sending null data on POST request to web api
body: <p>I want to POST data through curl windows 64 bits onto a asp.net web api(using C#) .
  However every tim i do so, the control passes to the HttpPost method however the values of the accepting parameter remains null.
  This works without curl on using url on browser..so no problem with database.</p>
  
  <p>My curl syntax is:</p>
  
  <pre><code>curl -X POST 'Content-Type:application/json' --data '[{"Id":"44","Name":"Abc","Category":"xyz","Price":"98"}]' "http://example.com/Post/Products"
  </code></pre>
  
  <p>My server side code of web api is </p>
  
  <pre><code>[ActionName("Default Action")]
  [Route("Post/Products")]
  [AcceptVerbs("Get"), HttpPost]
  public List&lt;ProductDetails&gt; PostProduct([FromBody] List&lt;ProductDetails&gt;  pro)
  {
      // IEnumerable&lt;string&gt; headerValues = Request.Headers.GetValues("MyCustomID");
      // var ide = headerValues.FirstOrDefault();
      // int id=Convert.ToInt16(pro.Id);
      // int Pric = Convert.ToInt16(Pricc);
      con = new SqlConnection("Data Source=(LocalDB)\\v11.0;AttachDbFilename=|DataDirectory|\\mydatabase.mdf;Integrated Security=True");
      SqlCommand ss = new SqlCommand("Insert into [Table] values ("+pro[0].Id+",'"+pro[0].Name+"','"+pro[0].Category+"',"+pro[0].Price+")", con);
      con.Open();
      SqlDataReader dr2 = ss.ExecuteReader();
      con.Close();
      con.Open();
      SqlCommand cmd=new SqlCommand ("select * from [Table]",con); 
      SqlDataReader dr1 = cmd.ExecuteReader();
      if (dr1.HasRows)
      {
          while (dr1.Read())
          {
              product1.Add(new ProductDetails() { Id = int.Parse(dr1[0].ToString()), Name = dr1[1].ToString(), Category = dr1[2].ToString(), Price = int.Parse(dr1[3].ToString()) });
          }
      }
      con.Close();
  
      if (ModelState.IsValid)
      {
          // var item = new pro { Id = id, Name = Nam, Category = Cate, Price = Pric };
          // products.Add(item);
          HttpResponseMessage response =Request.CreateResponse(HttpStatusCode.Created, product1);
          // response.Headers.Location = new Uri(Url.Link("DefaultApi1", new { id=item.Id }));               
      }
      return product1;
  }
  </code></pre>