I'm using NSURLSession
's dataTaskWithRequest
to download a file. It's gzipped, and it is automatically decompressed. However, I don't want it to be - I want the gzipped source. Is there any way to disable decompression?
NSURLSession
automatically inserts this value to your request's header:
"Accept-Encoding: gzip;q=1.0, compress;q=0.5"
which causes the downloaded data to be automatically decoded. So I think you should start by replacing the value of "Accept-Encoding" with something else.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With