title: HttpClient PostAsync() never return response
body: <p>My problem is very similar to this <a href="https://stackoverflow.com/questions/20734575/wp8-httpclient-postasync-never-returns-result">question</a> here. I have an <code>AuthenticationService</code> class that makes an <code>HttpClient</code> <code>PostAsync()</code> and never returns the result when I am running it from the ASP project, but when I implement it in a Console app it works just fine.</p>
  
  <p>This is my Authentication Service class:</p>
  
  <pre><code>public class AuthenticationService : BaseService
  {
      public async Task&lt;Token&gt; Authenticate (User user, string url)
      {
          string json = JsonConvert.SerializeObject(user);
          StringContent content = new StringContent(json, Encoding.UTF8, "application/json");
  
          HttpResponseMessage response = await _client.PostAsync(url, content);
          string responseContent = await response.Content.ReadAsStringAsync();
          Token token = JsonConvert.DeserializeObject&lt;Token&gt;(responseContent);
  
          return token;
      }
  }
  </code></pre>
  
  <p>And it is here where it hangs: <code>HttpResponseMessage response = await _client.PostAsync(url, content);</code></p>
  
  <p>Here is my Controller calling the service:</p>
  
  <pre><code>public ActionResult Signin(User user)
  {
      // no token needed to be send - we are requesting one
      Token token =  _authenticationService.Authenticate(user, ApiUrls.Signin).Result;
      return View();
  }
  </code></pre>
  
  <p>Here is an example of how I have been testing the service using a Console app, and it runs just fine.</p>
  
  <pre><code>class Program
  {
      static void Main()
      {
          AuthenticationService auth = new AuthenticationService();
  
          User u = new User()
          {
              email = "email@hotmail.com",
              password = "password123"
          };
  
          Token newToken = auth.Authenticate(u, ApiUrls.Signin).Result;
  
          Console.Write("Content: " + newToken.user._id);
          Console.Read();
      }
  }
  </code></pre>