user3095583
user3095583

Reputation: 75

How to learn gzip data byte weight?

How can I receive gzipped data length in bytes? NSURLConnection automatically decompress gzip data, and I can receive length in bytes only for decompressed data. But I need to know length for compressed data, so what size it go from serevr

Upvotes: 0

Views: 120

Answers (1)

neilco
neilco

Reputation: 8012

Take a look at the Content-Length header of the NSURLResponse. This will be the length of the gzipped data. This is available via the expectedContentLength property of NSURLResponse.

EDIT: If it's zero, then the server did not set a Content-Length header.

Upvotes: 1

Related Questions