This question is extension to the question here. I am using the code here reproduced below to GZIP compress a JSONObject.
String foo = \"value\
Content-Type:application/json - tells what type of content data in the http callContent-Encoding: gzip - tells what compression being used.application/json or text/xml or other type can be compressed as gzip and sending to receiver and with Content-Type header only, receiver will identify the incoming data is of type json/xml/text and then convert back to object of type json/xml/text.
With Content-Encoding header only receiver will identify the incoming data is getting gzip compressed. Then receiver required to decompress the incoming data and use it.