Why does HttpClient appear to hang without .Result? : <p>I have this code to call an API which returns a token. However, it will only return if I replace this line:</p>

<pre><code>var response = await TokenClient.PostAsync(EnvironmentHelper.TokenUrl, formContent);
</code></pre>

<p>with this line:</p>

<pre><code>var response = TokenClient.PostAsync(EnvironmentHelper.TokenUrl, formContent).Result;
</code></pre>

<p>Why?</p>

<pre><code>public static async Task&lt;Token&gt; GetAPIToken()
{
    if (DateTime.Now &lt; Token.Expiry)
        return Token;

    TokenClient.DefaultRequestHeaders.Clear();
    TokenClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
    TokenClient.BaseAddress = new Uri(EnvironmentHelper.BaseUrl);
    TokenClient.Timeout = TimeSpan.FromSeconds(3);

    var formContent = new FormUrlEncodedContent(new[]
    {
        new KeyValuePair&lt;string, string&gt;("grant_type", "client_credentials"),
        new KeyValuePair&lt;string, string&gt;("client_id", EnvironmentHelper.APITokenClientId),
        new KeyValuePair&lt;string, string&gt;("client_secret", EnvironmentHelper.APITokenClientSecret)
    });

    try
    {
        // HANGS - this next line will only ever return if suffixed with '.Result'
        var response = await TokenClient.PostAsync(EnvironmentHelper.TokenUrl, formContent);

        var content = await response.Content.ReadAsStringAsync();
        dynamic jsonContent = JsonConvert.DeserializeObject(content);

        Token token = new Token();
        token.AccessToken = jsonContent.access_token;
        token.Type = jsonContent.token_type;
        token.Expiry = DateTimeOffset.Now.AddSeconds(Convert.ToDouble(jsonContent.expires_in.ToString()) - 30);
        token.Scope = Convert.ToString(jsonContent.scope).Split(' ');

        Token = token;
    }
    catch (Exception ex)
    {
        var m = ex.Message;
    }

    return Token;
}
</code></pre>
