title: ASP.NET HTTPClient Get request status waiting for activation
body: <p>I am writing a method that will return JSON data by making a GET request to a RestApi URL. When I run the application in debug mode, I get below data in response.</p>
  
  <p><code>Id = 337, Status = WaitingForActivation, Method = "{null}", Result = "{Not yet computed}"</code></p>
  
  <p>Here is my code:</p>
  
  <pre><code>public class Methods
  {
      public static async Task&lt;JObject&gt; Get(string url, string username, string password)
      {
          var credentials = new NetworkCredential(username, password);
          HttpClientHandler handler = new HttpClientHandler { Credentials = credentials };
          HttpClient client = new HttpClient(handler);
          // client.BaseAddress = new Uri(url);
          client.DefaultRequestHeaders.Accept.Clear();
          client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
  
          HttpResponseMessage response = await client.GetAsync(url);
  
          if (response.IsSuccessStatusCode)
          {
              return JObject.Parse(await response.Content.ReadAsStringAsync());
          }
          return new JObject { response.StatusCode };
      }
  }
  </code></pre>
  
  <p>Here is my view where I am trying to access data:</p>
  
  <pre><code>public IActionResult Index()
  {
      // Methods RestMethod = new Methods();
      var data = Methods.Get("http://url/products", "domain\userid", "Password");
  
      return View();
  }
  </code></pre>
  
  <p>When I add debug in view at <code>var data = .....</code> thats where I am getting <code>waiting for activation</code>.</p>
  
  <p>Any help is really appreciated. :)</p>
  
  <p>Thanks,</p>
  
  <p>Ray</p>