Class GZConnectionRequest

java.lang.Object
com.codename1.io.ConnectionRequest
com.codename1.io.gzip.GZConnectionRequest
All Implemented Interfaces:
IOProgressListener

public class GZConnectionRequest extends ConnectionRequest

A connection request that can detect a GZipped response, parse it automatically and unzip it. Notice that some devices (iOS) always request gzip'ed data and always decompress it for us, however in the case of iOS it doesn't remove the gziped header. The GZConnectionRequest is aware of such behaviors so it's better to use that when connecting to the network (if applicable).

By default GZConnectionRequest doesn't request gzipped data (only unzips it when its received) but it's pretty easy to do so just add the HTTP header Accept-Encoding: gzip e.g.:

GZConnectionRequest con = new GZConnectionRequest();
con.addRequestHeader("Accept-Encoding", "gzip");
  • Constructor Details

    • GZConnectionRequest

      public GZConnectionRequest()
  • Method Details