PDA

View Full Version : How to download HTML file (from web) into NSString?




abecity
Sep 5, 2008, 03:01 PM
I'm working on a Cocoa command-line tool to download RSS feeds, and I'm wondering how to download a file that is on the web at some location http://site.com/file.xml and store the source code of that file in an NSString. Do I need the WebKit framework? If so, how can this be implemented with WebKit.

Thanks!



italiano40
Sep 5, 2008, 03:02 PM
use cURL to do it, very easy to do with cURL

caveman_uk
Sep 5, 2008, 03:10 PM
Take a look at the

+ (id)stringWithContentsOfURL:(NSURL *)url encoding:(NSStringEncoding)enc error:(NSError **)error

in NSString