The content is compressed. You need to send it through an unzip stream, like
import java.util.zip.GZIPInputStream;
...
InputStream content = response.getEntity().getContent();
content = new GZIPInputStream(content);
...
You should also check the content encoding first, and only wrap the stream into a GZIPInputStream
if the encoding actually is gzip
- some proxies transparently already uncompress the stream.
See SOQuery.java for a complete sample, even though this is using java.net.HttpURLConnection
rather than the apache client.