Exemplo n.º 1
0
        public BasicAuthenticatedHttpMessageHandler(BasicAuthenticatedHttpClientOptions options, HttpMessageHandler innerHandler = null)
        {
            InnerHandler = innerHandler ?? new HttpClientHandler();

            _authorizationHeader = new AuthenticationHeaderValue(
                "Basic",
                BasicAuthenticatedHttpMessageHandler.GenerateAuthenticationParameter(options.UserId, options.Password));
        }
Exemplo n.º 2
0
        public static HttpClient GetClient(BasicAuthenticatedHttpClientOptions options, HttpMessageHandler innerHandler = null)
        {
            var msgHandler = new BasicAuthenticatedHttpMessageHandler(options, innerHandler);

            return(new HttpClient(msgHandler));
        }