title: HttpClient GetAsync not working as expected
body: <p>When testing my web API with Postman my API get executes fine!</p>
  
  <p>When it comes to running the code with <code>HttpClient</code> in my client application the code executes without error but without the expected result on the server.
  What could be happening?</p>
  
  <p>From my client application:</p>
  
  <pre><code>private string GetResponseFromURI(Uri u)
  {
      var response = "";
      HttpResponseMessage result;
      using (var client = new HttpClient())
      {
          Task task = Task.Run(async () =&gt;
          {
              result = await client.GetAsync(u);
              if (result.IsSuccessStatusCode)
              {
                  response = await result.Content.ReadAsStringAsync();
              }
          });
          task.Wait();
      }
      return response;
  }
  </code></pre>
  
  <p>Here is the API controller:</p>
  
  <pre><code>[Route("api/[controller]")]
  public class CartsController : Controller
  {
      private readonly ICartRepository _cartRepo;
  
      public CartsController(ICartRepository cartRepo)
      {
          _cartRepo = cartRepo;
      }
  
      [HttpGet]
      public string GetTodays()
      {
          return _cartRepo.GetTodaysCarts();
      }
  
      [HttpGet]
      [Route("Add")]
      public string GetIncrement()
      {
          var cart = new CountedCarts();
          _cartRepo.Add(cart);
  
          return _cartRepo.GetTodaysCarts();
      }
  
      [HttpGet]
      [Route("Remove")]
      public string GetDecrement()
      {
          _cartRepo.RemoveLast();
          return _cartRepo.GetTodaysCarts();
      }
  
  
  }
  </code></pre>
  
  <p>Note these API calls work as expected when called from Postman.</p>