コード例 #1
0
        public string Stream1(int i)
        {
            var    persons = BuildModel();
            string json    = JsonConvert.SerializeObject(persons);
            var    result  = GZipHelper.GZipCompressString(json);

            return(result);
        }
コード例 #2
0
        public void Test()
        {
            var temp        = "abc123!@#";
            var comressed   = GZipHelper.GZipCompressString(temp);
            var decomressed = GZipHelper.GZipDecompressString(comressed);

            Assert.AreEqual(temp, decomressed);
        }
コード例 #3
0
        public string GzipHelper(string url, string person)
        {
            string   result   = string.Empty;
            GzipPost gzipPost = new GzipPost();

            gzipPost.GzipContent = GZipHelper.GZipCompressString(person);
            var gzipResult = HttpClientTool.HttpPost <GzipResult>(url, gzipPost);

            result = JsonConvert.SerializeObject(gzipResult);
            return(result);
        }