Trying to get the contents of a text file at this URL, but it does not seem to work. Any help?
NSURL *url = [NSURL URLwithString:@"http://haproxy.1wt.eu/download/1.9/keep-alive/keep-alive.txt"];
NSString *content = [NSString stringWithContentsOfURL:url encoding:NSASCIIStringEncoding];
NSLog(content);
The actual text file will be only 20 words, but this is just an example.
Am I doing it wrong? or is it much more complicated?
source
share