Reputation: 16327
I am using this NSURLConnection Delegate method
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{
long long rdata = [response expectedContentLength];
NSLog(@"Response Length : %lld", rdata);
}
its always showing -1
What is the format specifier for long long variable ?
Thanks
Upvotes: 1
Views: 1001
Reputation: 69342
From the docs on expectedContentLength
:
Return Value
The receiver’s expected content length, or
NSURLResponseUnknownLength
if the length can’t be determined.
NSURLResponseUnknownLength
is equals to -1. Have you tried inspecting the content-length header? The server you're connecting to is likely using a chunked transfer encoding, so the content-length is not available.
Upvotes: 9