Apple's URL loading system is a framework of classes available to interact with URLs. Using these classes together lets us communicate with services that use standard Internet protocols. The classes that we will be using in this chapter to connect to and retrieve information from REST services are as follows:
NSURLSession
: This is the main session object. It was written as a replacement for the olderNSURLConnection
API.NSURLSessionConfiguration
: This is used to configure the behavior of theNSURLSession
object.NSURLSessionTask
: This is a base class to handle the data being retrieved from the URL. Apple provides three concrete subclasses of theNSURLSessionTask
class.NSURL
: This is an object that represents the URL to connect to.NSMutableURLRequest
: This class contains information about the request that we are making and is used by theNSURLSessionTask
service to make the request.NSHTTPURLResponse
: This class contains the response to our request.
Now...