Ejemplo n.º 1
0
        public void Apply(HttpClientFactoryContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            context.PrependMessageHandler(new DefaultHeaderMessageHandler(_options, context.ClientName));
        }
        public void Apply(HttpClientFactoryContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            var handler = CreateHandler(context);

            handler.InnerHandler   = context.MessageHandler;
            context.MessageHandler = handler;
        }
        public void Apply(HttpClientFactoryContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            if (context.ClientName == HttpClientFactory.DefaultClientName)
            {
                return;
            }

            var options = _options.Get(context.ClientName);

            context.BaseAddress = options.BaseAddress;
        }
 protected override DelegatingHandler CreateHandler(HttpClientFactoryContext context)
 {
     return(new MessageHandler(CreateLogger(context.ClientName)));
 }
 protected abstract DelegatingHandler CreateHandler(HttpClientFactoryContext context);