Exemple #1
0
        public static Task <HttpClient> CreateAsync(this IHttpClientFactory factory, CancellationToken cancellationToken)
        {
            // Create the message handler.
            HttpMessageHandler handler = HttpMessageHandlerExtensions.CreateDefaultMessageHandler();

            // Call the overload.
            return(factory.CreateAsync(handler, cancellationToken));
        }
Exemple #2
0
 protected virtual Task <HttpClient> CreateHttpClientAsync(CancellationToken cancellationToken)
 {
     // Call the overload.
     return(CreateHttpClientAsync(HttpMessageHandlerExtensions.CreateDefaultMessageHandler(), cancellationToken));
 }