This question is extension to the question here. I am using the code here reproduced below to GZIP compress a JSONObject.
String foo = "value";
ByteArrayOutputStream baos = new ByteArrayOutputStream();
GZIPOutputStream gzos = null;
try {
gzos = new GZIPOutputStream(baos);
gzos.write(foo.getBytes("UTF-8"));
} finally {
if (gzos != null) try { gzos.close(); } catch (IOException ignore) {};
}
byte[] fooGzippedBytes = baos.toByteArray();
I am using a DefaultHttpClient to send this compressed JSONObject to server(the code is in my control).
My Question
What header should I use in my request? I am using request.setHeader("Content-type", "application/json"); for sending JSON to server?