How to download HTML file (from web) into NSString?

Discussion in 'Mac Programming' started by abecity, Sep 5, 2008.

  1. macrumors newbie

    Joined:
    Sep 5, 2008
    #1
    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!
     
  2. macrumors 65816

    italiano40

    Joined:
    Oct 7, 2007
    Location:
    NY
    #2
    use cURL to do it, very easy to do with cURL
     
  3. Guest

    caveman_uk

    Joined:
    Feb 17, 2003
    Location:
    Hitchin, Herts, UK
    #3
    Take a look at the
    Code:
    + (id)stringWithContentsOfURL:(NSURL *)url encoding:(NSStringEncoding)enc error:(NSError **)error
    
    in NSString
     

Share This Page