I have a large amount of data (~100k) that my C# app is sending to my Apache server with mod_gzip installed. I\'m attempting to gzip the data first using System.IO.Compressi
According to http://www.dominoexperts.com/articles/GZip-servlet-to-gzip-your-pages
You should setContentType() to the original format, as you are doing with the application/x-www-form-urlencoded I assume. Then...
// See if browser can handle gzip
String encoding=req.getHeader("Accept-Encoding");
if (encoding != null && encoding.indexOf("gzip") >=0 ) { // gzip browser
res.setHeader("Content-Encoding","gzip");
OutputStream o=res.getOutputStream();
GZIPOutputStream gz=new GZIPOutputStream(o);
gz.write(content.getBytes());
gz.close();
o.close();
} else { // Some old browser -> give them plain text. PrintWriter o = res.getWriter();
o.println(content);
o.flush();
o.close();
}