c# - Sending gzipped data in WebRequest? -
I have a large amount of data (~ 100k) that send my C # app with mod_gzip to my Apache server Used to be. I'm trying to gossip the data first using the system.IO.Compression.GZipStream. PHP gets raw jpeg data, so I hope Apache does not uncompress it. Am I missing something?
System.Net.WebRequest req = WebRequest.Create (this.Url); Req.Method = this.Method; // "post" req.Timeout = this.Timeout; Req.ContentType = "application / x-www-form-urlencoded"; Req.Headers.Add ("content-encoding: gzip"); System.IO.Stream reqStream = req.GetRequestStream (); Gzipstream jez = new gzipstream (rextreme, compression mod. Compress); System.IO.StreamWriter SW = New System. IO.StreamWriter (gz, encoding.ASCII); Sw.Write (large_amount_of_data); Sw.Close (); Gz.Close (); ReqStream.Close () System.Net.WebResponse resp = req.GetResponse (); // (Response handle ...)
I'm not completely convinced "content-encoding: gzip" applies to client-supplied headers.
I looked at the source code for mod_gzip
and I do not have any code Found decompresses information. Obviously mod_gzip
compresses only outgoing data which is not surprising after all. The functionality you are looking for may hardly be used less, and I'm afraid that you have to be unrelated to your own on the server.
Comments
Post a Comment