1

When I add an "Accept-Encoding: gzip" header field to my NSURLRequest, NSURLConnection.sendSynchronousRequest requests compressed data from the server and automatically decompresses the response data. Is there a way to prevent this, i.e. obtain the compressed (still gzipped) data?

Regards, Jochen

Jochen
  • 7,270
  • 5
  • 24
  • 32

1 Answers1

0

That kind of thing is acomplished using NSURLDownload class on Mac OS X. Apple says:

iOS Note: The NSURLDownload class is not available in iOS, because downloading directly to the file system is discouraged. Use the NSURLConnection class instead. See “Using NSURLConnection” for more information.

So, you'd want to evaluate your options - and use some library to zip it back and save it.

Community
  • 1
  • 1
zakishaheen
  • 5,551
  • 1
  • 22
  • 29
  • Running on iOS, having the system decompress it and then compress it again myself is probably not the best solution. – Jochen Nov 23 '11 at 00:16