InputStream is = new BufferedInputStream(new InflaterInputStream(new ByteArrayInputStream(body)), 10000);
return readContents(is, charset, maxKbytes);
} else if (encoding != null && encoding.equals("gzip")) {
byte[] body = m.getResponseAsBytes();
InputStream is = new BufferedInputStream(new GZIPInputStream(new ByteArrayInputStream(body)), 10000);
return readContents(is, charset, maxKbytes);
} else {
byte[] body = m.getResponseAsBytes(maxKbytes * 1000);
return new String(body, charset);