views:

624

answers:

4

Does the library Apache Commons HttpClient support Gzip? We wanted to use enable gzip compression on our Apache server to speed up the client/server communications (we have a php page that allows our Android application to sync files with the Server).

+2  A: 

It has no support for this out-of-the-box, and it seems unlikely to be added to HttpClient 3.x (see rather bitchy JIRA issue here). You can, however, do it by adding custom request readers and manual request/response stream handling, layered on top of the basic library, but it's fiddly.

It seems you can do it with HttpClient 4, but not without some effort.

Pretty shoddy, if you ask me, this stuff really should be easier than it is.

skaffman
+1 for the entertaining read (!)
karim79
@karim79: I've abandoned any hope that HttpClient is being maintained by anyone with a grip on reality (as if the HttpClient 4 API wasn't evidence enough).
skaffman
+2  A: 

Apache HttpClient 4.1 supports content compression out of the box along with many other features that were previously considered out of scope.

oleg
A: 

Apache Commons HttpClient it has no support for this out-of-the-box, but you can easily do it with Apache HttpCore 4.0.1

Dany