title: System.Net.HttpClient and cURL does not give identical results
body: <p>I have an issue i don't understand.</p>
  
  <p>My index.php is returning another page in JSON everytime i POST some variables, else it returns the generic page.</p>
  
  <p>Basically, it works as intended with the following command:</p>
  
  <pre><code>curl --data "menu=mychoice&amp;group=mygroup" http://localhost/index.php
  </code></pre>
  
  <p>returns the correct JSON object (and the generic index.php page if mychoice or mygroup is not valid)</p>
  
  <p>I tryed to implement this behaviour in C# but i can't succeed in retrieving the JSON object if menu and group are correct. Here is my code:</p>
  
  <pre><code>    private async void WebQuery()
      {
           var client = new HttpClient();
           var url = @"http://localhost/index.php";
  
  // not working
           var data = "menu=mymenu&amp;group=mygroup";
           StringContent queryString = new StringContent(data);
           HttpResponseMessage response = await client.PostAsync(url, queryString);
  
  // or, not working too                 
          var postData = new List&lt;KeyValuePair&lt;string, string&gt;&gt;();
          postData.Add(new KeyValuePair&lt;string, string&gt;("menu", "mymenu"));
          postData.Add(new KeyValuePair&lt;string, string&gt;("group", "mygroup"));
          HttpContent queryContent = new FormUrlEncodedContent(postData);
          HttpResponseMessage response = await client.PostAsync(url, queryContent);
  
          response.EnsureSuccessStatusCode();
          string content = await response.Content.ReadAsStringAsync();
          }
  </code></pre>
  
  <p>I'm either choosing HttpContent as StringContent or FormUrlEncodedContent, it does not work.</p>
  
  <p>My index.php looks like:</p>
  
  <pre><code>&lt;?php
  if (isset($_POST['menu') &amp;&amp; isset($_POST['group']))
  {
  echo json_encode(myarray);
  exit;
  }
  header('Location: generic.php');
  ?&gt;
  </code></pre>
  
  <p>I can't understand why it is working with curl and not with httpClient. Any hint, please ?</p>
  
  <p>Precision: if i replace POST by GET, it works as intended with HttpClient.</p>