Example #1
0
        protected override WebRequest GetWebRequest(Uri address)
        {
            WebRequest request = base.GetWebRequest(address);

            if (request is HttpWebRequest)
            {
                if (HttpItem != null)
                {
                    HttpHelper.SetRequest(HttpItem, request as HttpWebRequest);
                }
            }
            HttpWebRequest httpRequest = (HttpWebRequest)request;

            httpRequest.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
            return(httpRequest);
        }
Example #2
0
        protected override WebRequest GetWebRequest(Uri address)
        {
            var request = base.GetWebRequest(address);

            if (request is HttpWebRequest)
            {
                if (HttpItem != null)
                {
                    HttpHelper.SetRequest(HttpItem, request as HttpWebRequest);
                }
                (request as HttpWebRequest).CookieContainer = cookie;
            }
            //HttpWebRequest httpRequest = (HttpWebRequest)request;
            //httpRequest.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
            return(request);
        }