Organization of This Document
See Also
This programming topic describes the Foundation framework classes available for interacting with URLs and communicating with servers using standard Internet protocols. Together theses classes are referred to as the URL loading system.
The NSURL class provides the ability to manipulate URLs and the resources they refer to.
The Foundation framework also provides a rich collection of classes that include support for URL loading, cookie storage, response caching, credential storage and authentication, and writing custom protocol extensions.
The URL loading system provides support for accessing resources using the following protocols:
File Transfer Protocol (ftp://)
Hypertext Transfer Protocol (http://)
Secure 128-bit Hypertext Transfer Protocol (https://)
Local file URLs (file:///)
It also transparently supports both proxy servers and SOCKS gateways using the user’s system preferences.
This programming topic includes the following articles:
“URL Loading System Overview” describes the classes of the URL loading system and their interaction.
“Downloading Data Synchronously” describes the NSURLConnection support for synchronous connections.
“Using NSURLConnection” describes using NSURLConnection for asynchronous connections.
“Using NSURLDownload” describes using NSURLDownload to download files asynchronously to disk.
“Understanding Cache Access” describes how a connection uses the cache during a request.
“NSURLDownload and NSURLConnection Differences” describes subtle differences in behavior between these two classes.
The following sample code is available through Apple Developer Connection:
SpecialPictureProtocol implements a custom NSURLProtocol that creates jpeg images in memory as data is downloaded.
AutoUpdater demonstrates how to check for, and download, an application update using NSURLConnection and NSURLDownload.
Last updated: 2008-05-06