I am having trouble trying to do a partial get request using NSURLMutableRequest.
I set up the header values as follows:
NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:url];
NSString* range = [NSString stringWithFormat:@"bytes %d-%d/%d", receivedContentLength, expectedContentLength, expectedContentLength];
[request setHTTPMethod:@"GET"];
[request addValue:[fmt stringFromDate:[NSDate date]] forHTTPHeaderField:@"Date"];
[request addValue:@"application/octet-stream" forHTTPHeaderField:@"Content-Type"];
[request addValue:@"bytes" forHTTPHeaderField:@"Accept-Ranges"];
[request addValue:range forHTTPHeaderField:@"Content-Range"];
[request addValue:[NSString stringWithFormat:@"%d", (expectedContentLength - receivedContentLength)] forHTTPHeaderField:@"Content-Length"];
I have validated (using WGet) that the url that i am using supports partial get requests. The reason I cannot use the resume functionality of NSURLDownload is that it requires the eTag, something that the server doesn't currently support.
Am I missing something with the way I am setting up the header??
Thanks!