title: C# Request - API LiveChat
body: <p>i've been following this <a href="https://stackoverflow.com/questions/7929013/making-a-curl-call-in-c-sharp">Making a cURL call in C#</a> for trying to make a request with the LiveChat API in curl and receive the result on my C# application,</p>
  
  <p>the request should be filled as the following as explained in: <a href="http://developers.livechatinc.com/rest-api/#!introduction" rel="nofollow noreferrer">http://developers.livechatinc.com/rest-api/#!introduction</a></p>
  
  <pre><code>curl "https://api.livechatinc.com/agents" \
      -u john.doe@mycompany.com:c14b85863755158d7aa5cc4ba17f61cb \
      -H X-API-Version:2 
  </code></pre>
  
  <p>This is what i did in C#:</p>
  
  <pre><code>static void Main(string[] args)
  {
      RequestTest();
      Console.ReadKey();
  }
  
  private static async void RequestTest()
  {
      var client = new HttpClient();
  
      // Create the HttpContent for the form to be posted.
      var requestContent = new FormUrlEncodedContent(new[] {new KeyValuePair&lt;string, string&gt;("myemail:myapikey", "X-API-Version:2"),});
  
      // Get the response.
      HttpResponseMessage response = await client.PostAsync(
          "https://api.livechatinc.com/agents",
          requestContent);
  
      // Get the response content.
      HttpContent responseContent = response.Content;
  
      // Get the stream of the content.
      using (var reader = new StreamReader(await responseContent.ReadAsStreamAsync()))
      {
          // Write the output.
          Console.WriteLine(await reader.ReadToEndAsync());
      }
  }
  </code></pre>
  
  <p>The result seems to be allways the same "Cannot POST to /agents"</p>