Esempio n. 1
0
        private HttpClient CreateClient()
        {
            var handler = _messageHandlerFactory.GetHttpMessageHandler(new NetworkCredential(_user, _password, _domain), ignoreCertErrors: _ignoreCertErrors);
            var client  = new HttpClient(new DigestAuthenticationMessageHandler(handler));

            client.Timeout = Timeout.InfiniteTimeSpan;
            return(client);
        }
Esempio n. 2
0
 public ServiceBase(IHttpMessageHandlerFactory messageHandlerFactory)
 {
     MessageHandlerFactory = messageHandlerFactory;
     CurrentHttpClient     = new HttpClient(MessageHandlerFactory.GetHttpMessageHandler());
     CurrentHttpClient.DefaultRequestHeaders.Add("x-functions-key", apiKey);
 }