title: web api http post passing object 504 Receive Failure
body: <p>debugging on my local machine. I have fidder simulate requests to http post web api <code>http://localhost:15147/api/Pacel/CreatePacel/</code></p>
  
  <p>if I set fidder "Composer"--"Request Headers" to:</p>
  
  <pre><code>User-Agent: Fiddler
  Accepted: application/json
  Content-Type: application/json
  Content-Length: 0
  Host: localhost:15147
  </code></pre>
  
  <p>it did work and i am confirmed it can go into my breakpoint at “<code>if (pacel == null)  // SET BREAKPOINT HERE</code>”</p>
  
  <p>but if i set <code>Content-Length: 1000</code> and add "Request Body" in fidder "Composer" as:</p>
  
  <pre><code>{
     "id": 3
     "province":"US",
     "city":"US"
  }
  </code></pre>
  
  <p>it does not go into the breakpoint “<code>if (pacel == null)  // SET BREAKPOINT HERE</code>”</p>
  
  <p>could anybody know what is the problem?</p>
  
  <p>action method in PacelContrller is in below:</p>
  
  <pre><code>// POST api/values
          [HttpPost]
          [ActionName("CreatePacel")]
          public HttpResponseMessage CreatePacel([FromBody]Pacel pacel)
          {
              try
              {
                  if (pacel == null)  // SET BREAKPOINT HERE
                  {
                      return Request.CreateErrorResponse(HttpStatusCode.BadRequest, "can not read object from body.");
                  }
                  else
                  {
                      int effectedRows = 0;
                      effectedRows = pr.Add(pacel);
                      if (effectedRows == 0)
                      {
                          return Request.CreateErrorResponse(HttpStatusCode.BadRequest, "can not save to the db.");
                      }
                      else
                      {
                          return Request.CreateResponse(HttpStatusCode.Created, "created items in db success.");
                      }
  
                  }
              }
              catch (Exception ex)
              {
                  return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex);
              }
  
  
          }
  </code></pre>
  
  <p>Pacel Model is below:</p>
  
  <pre><code>public partial class Pacel
      {
          public long pacelId { get; set; }
          public Nullable&lt;System.DateTime&gt; arrivedDate { get; set; }
          public Nullable&lt;System.DateTime&gt; signDate { get; set; }
          public string signname { get; set; }
          public Nullable&lt;long&gt; customerId { get; set; }
          public string province { get; set; }
          public string city { get; set; }
          public string district { get; set; }
          public string campname { get; set; }
          public string bldNumber { get; set; }
          public string unitNumber { get; set; }
          public string roomNumber { get; set; }
          public string type { get; set; }
      }
  </code></pre>
  
  <p><em><strong>EDIT after @Rafa answer</em></strong></p>
  
  <p>with body { "pacelId": 3 "province":"US", "city":"US" } and leave content length = 0; it can work well(means it can go into the breakpoint). but the object cannot be passed in the serverside. at the breakpoint, it shows <code>pacel</code> is null</p>