[![Build Status](https://travis-ci.org/AFNetworking/AFNetworking.png?branch=master)](https://travis-ci.org/AFNetworking/AFNetworking) AFNetworking is a delightful networking library for iOS and Mac OS X. It's built on top of [NSURLConnection](http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/Reference/Reference.html), [NSOperation](http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSOperation_class/Reference/Reference.html), and other familiar Foundation technologies. It has a modular architecture with well-designed, feature-rich APIs that are a joy to use. For example, here's how easy it is to get JSON from a URL: ```objective-c NSURL *url = [NSURL URLWithString:@"https://alpha-api.app.net/stream/0/posts/stream/global"]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) { NSLog(@"App.net Global Stream: %@", JSON); } failure:nil]; [operation start]; ``` Perhaps the most important feature of all, however, is the amazing community of developers who use and contribute to AFNetworking every day. AFNetworking powers some of the most popular and critically-acclaimed apps on the iPhone, iPad, and Mac. Choose AFNetworking for your next project, or migrate over your existing projects—you'll be happy you did! ## How To Get Started - [Download AFNetworking](https://github.com/AFNetworking/AFNetworking/zipball/master) and try out the included Mac and iPhone example apps - Read the ["Getting Started" guide](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking), [FAQ](https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-FAQ), or [other articles in the wiki](https://github.com/AFNetworking/AFNetworking/wiki) - Check out the [complete documentation](http://cocoadocs.org/docsets/AFNetworking/) for a comprehensive look at the APIs available in AFNetworking - Watch the [NSScreencast episode about AFNetworking](http://nsscreencast.com/episodes/6-afnetworking) for a quick introduction to how to use it in your application - Questions? [Stack Overflow](http://stackoverflow.com/questions/tagged/afnetworking) is the best place to find answers ## Overview AFNetworking is architected to be as small and modular as possible, in order to make it simple to use and extend.
Core | |
---|---|
AFURLConnectionOperation | An NSOperation that implements the NSURLConnection delegate methods. |
HTTP Requests | |
AFHTTPRequestOperation | A subclass of AFURLConnectionOperation for requests using the HTTP or HTTPS protocols. It encapsulates the concept of acceptable status codes and content types, which determine the success or failure of a request. |
AFJSONRequestOperation | A subclass of AFHTTPRequestOperation for downloading and working with JSON response data. |
AFXMLRequestOperation | A subclass of AFHTTPRequestOperation for downloading and working with XML response data. |
AFPropertyListRequestOperation | A subclass of AFHTTPRequestOperation for downloading and deserializing objects with property list response data. |
HTTP Client | |
AFHTTPClient |
Captures the common patterns of communicating with an web application over HTTP, including:
|
Images | |
AFImageRequestOperation | A subclass of AFHTTPRequestOperation for downloading and processing images. |
UIImageView+AFNetworking | Adds methods to UIImageView for loading remote images asynchronously from a URL. |