How to know from which point HttpClient task cancellation is triggered
问题 I have the following code to fetch the bearer token and then call the Web API in a c# application. public async Task<HttpResponseMessage> SendHttpRequest() { HttpResponseMessage response = null; try { HttpClient client = new HttpClient(); string accessToken = await GetBearerToken(resourceUrl, clientId, clientSecret, tokenProviderUrl); if (!string.IsNullOrEmpty(accessToken)) httpRequest.Headers.Add("Authorization", ("Bearer " + accessToken)); response = await client.SendAsync(httpRequest); }