Skip to content
This repository

Does RestKit support GZip? #511

Closed
haemi opened this Issue January 19, 2012 · 3 comments

3 participants

Stefan Walkner Blake Watters
Stefan Walkner

Hello,

I'm using the following line to configure RestKit:

[[RKClient sharedClient] setValue:@"gzip" forHTTPHeaderField:@"Accept-Encoding"];

Nevertheless I get the following HeaderFields back from the Server:

(gdb) po [[objectLoader response] allHeaderFields]
{
Connection = "Keep-Alive";
"Content-Type" = "application/json";
Date = "Thu, 19 Jan 2012 16:54:00 GMT";
"Keep-Alive" = "timeout=5, max=98";
Server = Apache;
"Transfer-Encoding" = Identity;
}

Does RestKit support GZip? If yes - what am I doing wrong?

Thanks a lot,

Stefan

I would also like to know how Restkit works with GZIP

Blake Watters
Owner

RestKit is built on top of NSURLConnection, which provides transparent gzip/deflate support for response bodies. This should work with a server supporting gzip/deflate:

// Client level
[[RKClient sharedClient] setValue:@"gzip, deflate" forHTTPHeaderField:@"Accept-Encoding"];
Stefan Walkner

added a Pull Request for this.

Stefan Walkner haemi closed this January 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.