fer626 / google-api-java-client

Automatically exported from code.google.com/p/google-api-java-client
0 stars 0 forks source link

Add GoogleClient.Builder.setEnableGZipContent #488

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
External references, such as a standards document, or specification?

http://javadoc.google-api-java-client.googlecode.com/hg/1.8.0-beta/com/google/ap
i/client/googleapis/services/GoogleClient.Builder.html

http://javadoc.google-http-java-client.googlecode.com/hg/1.8.3-beta/com/google/a
pi/client/http/HttpRequest.html#setEnableGZipContent(boolean)

Java environments (e.g. Java 6, Android 2.3, App Engine, or All)?

All

Please describe the feature requested.

There some special cases where GZip compression is not supported for APIs on 
Google infrastructure.  Currently GoogleClient.buildHttpRequest() calls 
httpRequest.setEnableGZipContent(true).  So without customization this will 
fail in those cases.

You *can* override the default currently, but it is painful to do and highly 
non-discoverable: you can set up an HttpRequestInitializer that sets itself as 
the HttpRequestInterceptor and then that interceptor disables GZip.  If you 
already have an HttpRequestInitializer it gets more complicated.

A much simpler developer experience would be to add a setEnableGZipContent 
property to GoogleClient.Builder.   It would be true by default, but you can 
call setEnableGZipContent(false) in such special cases.

Original issue reported on code.google.com by yan...@google.com on 15 May 2012 at 11:15

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 15 May 2012 at 11:17

GoogleCodeExporter commented 9 years ago
http://codereview.appspot.com/6198078/

Original comment by rmis...@google.com on 16 May 2012 at 2:13

GoogleCodeExporter commented 9 years ago

Original comment by rmis...@google.com on 17 May 2012 at 2:14