I have an NSURLConnection and in didReceiveResponse
I\'m checking [response expectedContentLength]
and getting really large values like 18446744073
To avoid this problem, set header field "Accept-Encoding" to @"gzip;q=0". that tells the server that you do not accept gzip, and will if possible send uncompressed.
The answer, related to the comments, is that it's because the result is gzip encoded. Oddly, the value for the expectedContentLength
seems to be junk, and cannot be trusted. If the result is gzip encoded, then NSURLConnection
cannot properly determine the size of the unencoded result.