解决方案 »

  1.   

    http://www.cnblogs.com/aspxcn/archive/2008/01/10/1032482.html
      

  2.   


    ls说的对,
    有这一行是说编码格式的:
    content-encoding:gzip
      

  3.   

    拿我用正文的GZIP内容 可以转成字串的把?
      

  4.   

    ///   <summary>
    ///   压缩文件流
    ///   </summary>
    ///   <param   name= "uncompressedString "> </param>
    ///   <returns> </returns>
    static   public   string   Compress(string   uncompressedString)
    {
    byte[]   byteData   =   System.Text.Encoding.UTF8.GetBytes(uncompressedString);
    MemoryStream   ms   =   new   MemoryStream();
    Stream   s   =   new   GZipOutputStream(ms);
    s.Write(byteData,0,byteData.Length);
    s.Close();
    byte[]   compressData   =   (byte[])ms.ToArray();
    ms.Flush();
    ms.Close();
    return   System.Convert.ToBase64String(compressData,0,compressData.Length);
    }///   <summary>
    ///   减压文件流
    ///   </summary>
    ///   <param   name= "comppressedString "> </param>
    ///   <returns> </returns>
    static   public   string   DeCompress(string   comppressedString)
    {
    int   size   =   0;
    string   uncompressString   =   string.Empty;
    StringBuilder   sb   =   new   StringBuilder(40960);
    int   totalLength   =   0;
    byte[]   byteInput   =   System.Convert.FromBase64String(comppressedString);
    byte[]   writeData   =   new   byte[4096];
    Stream   s   =   new   GZipInputStream(new   MemoryStream(byteInput));
    while(true)
    {
    size   =   s.Read(writeData,0,writeData.Length);
    if(size   >   0)
    {
    totalLength   +=   size;
    sb.Append(System.Text.Encoding.UTF8.GetString(writeData,0,size));
    }
    else
    {
    break;
    }
    }
    s.Flush();
    s.Close();
    return   sb.ToString();
    }来自其他高手的代码.
      

  5.   

    http://files.cnblogs.com/huihui0630/GZipDemo.7z
    示例.
      

  6.   

    请问下这种的是什么响应,HTTP/1.0 200 OK
    Server: Apache-Coyote/1.1
    Accept-Ranges: bytes
    Content-Length: 11
    Content-Type: application/octet-stream;charset=UTF-8
    Connection: close
    ۦ%(
      

  7.   

    这是截图。谢谢。。我看了,POST的内容,和响应的 都是 乱码,很奇怪不知道如何能知道是怎么产生的这乱码
      

  8.   

    这是将 HTTP响应 数据 保存下来的 样子。
      

  9.   

    GZip 头中的幻数不正确。请确保正在传入 GZip 流。我用了GZIP。。不可以啊