Is GZip Supported from HttpRequest - CSharp System.IO.Compression

CSharp examples for System.IO.Compression:GZip

Description

Is GZip Supported from HttpRequest

Demo Code


using System.Web;

public class Main{
        public static bool IsGZipSupported(HttpRequest request)
        {//from w w w . j  av a2s. c  o  m
            string encoding = request.Headers["Accept-Encoding"];
            if (!string.IsNullOrEmpty(encoding) && encoding.Contains("gzip"))
            {
                return true;
            }
            else
            {
                return false;
            }
        }
}

Related Tutorials