title: HttpClient PostAsync call in Console application is not finishing
body: <p>I am trying to send 100 messages to an web api from a console application. But the program is ending before sending the messages to the web api. If I put <code>Console.ReadLine();</code> at the end it is working. Can any one help me with this issue?</p>
  
  <p>I've posted the code I used below. </p>
  
  <pre><code>static void Main(string[] args)
  {
      CreateLog();
  }
  
  private static void CreateLog()
  {
      for(int i=0;i&lt;100;i++)
      ProcessLog(new LogMessage() { });         
  }
  
  private static void ProcessLog(LogMessage message)
  {
      //Post message to web service
      HttpClient client = new HttpClient();
      client.BaseAddress = new Uri(@"web api url");
      client.DefaultRequestHeaders.Accept.Add(
          new MediaTypeWithQualityHeaderValue("application/json"));                   
      HttpContent contentPost = new StringContent(
          JsonConvert.SerializeObject(message), 
          Encoding.UTF8, 
          "application/json");
      client.PostAsync("api/xxx", contentPost);
  }
  </code></pre>