NSURL *myURL = [NSURL URLWithString:@"http://www.apple.com/"];
NSData *urlContents = [myURL resourceDataUsingCache:YES];
if ([urlContents writeToFile:[@"~/Documents/applewebsite.html" stringByExpandingTildeInPath] atomically:YES]) { // It was successful, do stuff here } else { // There was a problem writing the file }
curl --head 'http://www.macosx.com'