Ejemplo n.º 1
0
        public ExecutionContext(SetupContext setupContext, HttpActionContext httpActionContext)
        {
            _setupContext      = setupContext;
            _httpActionContext = httpActionContext;

            var httpClientHandler = new HttpClientHandler
            {
                AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate,
            };

            var handler = !_setupContext.ContentMD5() ? (HttpMessageHandler)httpClientHandler : new ContentMd5Handler()
            {
                InnerHandler = httpClientHandler
            };

            _httpClient = new HttpClient(handler, true);
        }