I am implementing
-(void)request:(RKRequest *)request didReceivedData:(NSInteger)bytesReceived totalBytesReceived:(NSInteger)totalBytesReceived totalBytesExpectedToReceive:(NSInteger)totalBytesExpectedToReceive {
NSLog(@"totalBytesExpectedToReceive = [%i] : totalBytesReceived = [%i]", totalBytesExpectedToReceive, totalBytesReceived);
}
But I only get the totalBytesReceived correctly. The totalBytesExpectedToReceive always returns -1.
What can be the problem ?
Thanks
Shani
RestKit use
Content-LengthHTTP header sent in the response to determine the expected length. I recommend you to set log level to Trace in your AppDelegate:and find the headers in your log. Look for a statement like this
if the
"Content-Length"is missing from your output there is no way for RestKit to tell you how much data is expected.