/// <inheritdoc cref="WebRequestTransport" />
        public WebRequestTransport(WebRequestTransportSettings settings, ILog log)
        {
            Settings = settings;

            this.log = log ?? throw new ArgumentNullException(nameof(log));

            connectTimeLimiter = new ConnectTimeLimiter(log);
            responseFactory    = new ResponseFactory(settings);

            WebRequestTuner.Touch();
        }
        public static HttpWebRequest Create(Request request, TimeSpan timeout, WebRequestTransportSettings settings, ILog log)
        {
            var webRequest = WebRequest.CreateHttp(request.Url);

            webRequest.Method = request.Method;

            WebRequestTuner.Tune(webRequest, timeout, settings);

            if (settings.FixNonAsciiHeaders)
            {
                request = NonAsciiHeadersFixer.Fix(request);
            }

            WebRequestHeadersFiller.Fill(request, webRequest, log);

            return(webRequest);
        }