title: How to pass variable into POST request using HttpClient
body: <p>I am figuring out the new <code>HttpClient</code>.</p>
  
  <p>I try to POST a http uri like this:</p>
  
  <p><code>http://server/API/user/login?login=name&amp;password=password</code></p>
  
  <p>I thought this would be the way to go:</p>
  
  <pre><code>using (var client = new HttpClient())
  {
      var values = new List&lt;KeyValuePair&lt;string, string&gt;&gt;
      {
          new KeyValuePair&lt;string, string&gt;("login", "user"),
          new KeyValuePair&lt;string, string&gt;("password ", "password")
      };
  
      var content = new FormUrlEncodedContent(values);
  
      var response = await client.PostAsync("http://server/REST/user/login", content);
  }
  </code></pre>
  
  <p>The only way I can get it to work is:</p>
  
  <pre><code>using (var client = new HttpClient())
  {
      var response = await client.PostAsync("http://server/REST/user/login?login=user&amp;password=password",null);
  }
  </code></pre>
  
  <p>Is the last way the correct way or am I doing something wrong in the first approach?</p>