title: When I using a thread to run HttpClient.GetAsync(...) and it never returns response
body: <p>I using a C# Console app to test Httpclient GetSync().</p>
  <p>When code run in getsync() and just close done my app.I need to get the response result.
  Is the thread and task await to conflict or the thread is not the main thread?</p>
  <p>Where the code i misusing.</p>
  <p>Program.cs</p>
  <pre><code>using System;
  using System.Threading;
  using AutoProcessWorks;
  
  _AutoProcessWorks autoProcessWorks = new _AutoProcessWorks();
  Thread AutoRunThread = new Thread(new ThreadStart(autoProcessWorks.MainRun));
  AutoRunThread.Start();
  </code></pre>
  <p>AutoProcessWorks.cs is here</p>
  <pre><code>public class _AutoProcessWorks
  {
      Api api = new Api();
      SqlTools sqlTools = new SqlTools();
      public bool Switch_Run = true;
      public void MainRun()
      {
          int sleep = 60000;
          Api api = new Api();
          while (Switch_Run)
          {
              var route = &quot;IsNFTContractEnough&quot;;
              var res = api.CallPythonApiGet(route);
              Console.WriteLine(res);
              Switch_Run = false;
          }
      }
  public class Api
  {
      public async Task&lt;string&gt; CallPythonApiGet(string route)
      {
          const string uri = &quot;http://127.0.0.1:5000/&quot;;
          using (HttpClient client = new HttpClient())
          {
              var respones_result = &quot;&quot;;
              try
              {
                  client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(&quot;application/json&quot;));
                  client.Timeout = TimeSpan.FromSeconds(600);
                  var response = await client.GetAsync(uri + route);
                  respones_result = response.Content.ReadAsStringAsync().Result;
                  response.EnsureSuccessStatusCode();
                  string responseBody = await response.Content.ReadAsStringAsync();
                  return responseBody;
              }
              catch (HttpRequestException e)
              {
                  var error = &quot;&quot;;
                  error += respones_result + &quot;\n\r&quot;;
                  error += &quot;\nException Caught! Message :&quot; + e.Message;
                  return error;
              }
          }
      }
  }
  </code></pre>