Goodreads Developers discussion

66 views
gzip

Comments (showing 1-6 of 6) (6 new)    post a comment »
dateDown arrow    newest »

message 1: by Michael, Problems Architect (new)

Michael Economy (michaeleconomy) | 656 comments Mod
I'd just like to point out that we support gzip, so if you enable gzip compression on your requests it will make your api requests a lot faster in most cases...


message 2: by Tom (new)

Tom | 5 comments Cool. Can you share an example?


message 3: by Michael, Problems Architect (new)

Michael Economy (michaeleconomy) | 656 comments Mod
It's different on each platform, I'll see if our mobile guys have some examples from their apps.


message 4: by Ettore (new)

Ettore Pasquini | 217 comments On pretty much all client platforms it should be just a matter of setting the value "gzip" for the "Accept-Encoding" HTTP header field of your request.

On the iPhone, given you have a NSMutableURLRequest, it's as simple as calling:
[httpreq setValue:@"gzip" forHTTPHeaderField:@"Accept-Encoding"];

Similarly on Android, given you have a HttpRequestBase object, you can add it by doing:
httpreq.addHeader("Accept-Encoding", "gzip");



message 5: by Tom (new)

Tom | 5 comments That should help. Thanks :)


message 6: by Jason (new)

Jason (JasonShort) | 2 comments A couple of interesting links for Windows Phone developers:

http://www.sharpgis.net/post/2012/01/...

NUGET package that lets you use a GZipWebClient as a drop in replacement for WebClient.

http://www.nuget.org/packages/SharpGI...


back to top

unread topics | mark unread