Creating a web client using AFHTTPSessionManager

In this recipe, we will be subclassing AFHTTPSessionManger to create a class that can be used to access the iTunes Search API. This class will be reliant on Apple's NSURLSessionConfiguration and NSURLSessionDataTask classes to implement the network functionality. Therefore, the minimum system requirements for this recipe will be iOS 7 or Mac OS X 10.9.

The AFHTTPSessionManager class is a subclass of AFURLSessionManager that contains methods for making standard HTTP requests, such as GET, POST, and DELETE. When we set the baseURL property, these HTTP requests will be made using relative paths. In this recipe, we will be setting the baseURL property to https://itunes.apple.com/; therefore, all HTTP ...

Get iOS and OS X Network Programming Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.