title: Posting data with HttpClient on Nginx.. Error 411 C#
body: <p>I'm testing the new Framework .Net 4.5 introducing new classes like HttpClient.
  I'm trying to login into a vbulletin forum and posting a subject.</p>
  
  <p>It works perfectly using WampServer, but when I try with Nginx i've a 411 Error, Content-Lenght Required.</p>
  
  <p>This is my code : </p>
  
  <pre><code>HttpClient client = new HttpClient();
  
  /* login part skipped, it works */
  
  postData = new List&lt;KeyValuePair&lt;string, string&gt;&gt;();
  postData.Add(new KeyValuePair&lt;string, string&gt;("do", "postthread"));
  postData.Add(new KeyValuePair&lt;string, string&gt;("f", "8"));
  postData.Add(new KeyValuePair&lt;string, string&gt;("loggedinuser", "1"));
  postData.Add(new KeyValuePair&lt;string, string&gt;("message", "myMessage"));
  postData.Add(new KeyValuePair&lt;string, string&gt;("subject", "mySubject : " + new Random().Next()));
  postData.Add(new KeyValuePair&lt;string, string&gt;("securitytoken", secure_id));
  postData.Add(new KeyValuePair&lt;string, string&gt;("vbseo_is_retrtitle", "1"));
  postData.Add(new KeyValuePair&lt;string, string&gt;("vbseo_retrtitle", "1"));
  postData.Add(new KeyValuePair&lt;string, string&gt;("posthash", posthash));
  postData.Add(new KeyValuePair&lt;string, string&gt;("poststarttime", poststarttime));
  
  HttpContent content = new FormUrlEncodedContent(postData);
  HttpRequestMessage msg3 = new HttpRequestMessage(HttpMethod.Post, "http://localhost/newthread.php?do=postthread&amp;f=8");
  
  // Adding all headers from the resp2, containing cookie value to stay connected
  // I think, here is the problem, when passing the 'Transfer-Encoding' and 'Transfer-EncodingChunked' values
  foreach (var header in resp2.Headers)
     msg3.Headers.Add(header.Key, header.Value);
  
  msg3.Content = content;
  var resp3 = client.SendAsync(msg3).Result;
  resp3.EnsureSuccessStatusCode();
  string html = resp3.Content.ReadAsStringAsync().Result;
  </code></pre>
  
  <p>When I see the msg3.Content.Headers.ContentLength, I've a value.. So I don't understand why Nginx throw me this error :/</p>
  
  <p>After Googling, i saw that <a href="http://wiki.nginx.org/HttpChunkinModule" rel="nofollow">http://wiki.nginx.org/HttpChunkinModule</a> but I don't want to modify the server.. </p>
  
  <p>Thanks for any help..</p>