From 4ef3c712606d10e289fe89bf917c00d5328a4f11 Mon Sep 17 00:00:00 2001 From: Mattt Thompson Date: Sun, 22 Jan 2012 11:42:46 -0800 Subject: [PATCH] Minor formatting changes to README --- README.md | 46 ++++++++++------------------------------------ 1 file changed, 10 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 777a679..c27bd5d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -![AFNetworking](https://github.com/AFNetworking/AFNetworking/raw/gh-pages/afnetworking-logo.png "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: +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://gowalla.com/users/mattt.json"]; @@ -13,7 +13,7 @@ AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperation 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! +Choose AFNetworking for your next project, or migrate over your existing projects—you'll be happy you did! ## How To Get Started @@ -26,13 +26,13 @@ Choose AFNetworking for your next project, or migrate over your existing project AFNetworking is architected to be as small and modular as possible, in order to make it simple to use and extend. - + - + - + @@ -48,10 +48,10 @@ AFNetworking is architected to be as small and modular as possible, in order to - + - + - + - +
Core
Core
AFURLConnectionOperationAn NSOperation subclass that implements the NSURLConnection delegate methods.An NSOperation that implements the NSURLConnection delegate methods.
HTTP Requests
HTTP Requests
AFHTTPRequestOperation
AFPropertyListRequestOperationA subclass of AFHTTPRequestOperation for downloading and deserializing objects with property list (plist) response data.A subclass of AFHTTPRequestOperation for downloading and deserializing objects with [property list](http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/PropertyLists/index.html) response data.
HTTP Client
HTTP Client
AFHTTPClient @@ -70,14 +70,14 @@ AFNetworking is architected to be as small and modular as possible, in order to
Images
Images
AFImageRequestOperation A subclass of AFHTTPRequestOperation for downloading an processing images.
UIImageView+AFNetworkingAdds methods to the UIKit framework’s UIImageView class. The methods in this category provide support for loading remote images asynchronously from a URL.Adds methods to `UIImageView` for loading remote images asynchronously from a URL.
@@ -101,14 +101,6 @@ UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0f, 0.0 [imageView setImageWithURL:[NSURL URLWithString:@"http://i.imgur.com/r4uwx.jpg"] placeholderImage:[UIImage imageNamed:@"placeholder-avatar"]]; ``` -``` objective-c -NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://gowalla.com/images/web/logo.png"]]; -AFImageRequestOperation *operation = [AFImageRequestOperation imageRequestOperationWithRequest:request success:^(NSImage *image){ - NSLog(@"Image loaded: %@", image); -}]; -[operation start]; -``` - ### API Client Request ``` objective-c @@ -136,24 +128,6 @@ AFHTTPRequestOperation *operation = [[[AFHTTPRequestOperation alloc] initWithReq [operation start]; ``` -### Request With HTTP Authorization Header - -``` objective-c -NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://gowalla.com/friendships/request?user_id=1699"]]; -[request setHTTPMethod:@"POST"]; -[request setValue:@"#{Base64-Encoded Credentials}" forHTTPHeaderField:@"Authorization"]; - -AFHTTPRequestOperation *operation = [[[AFHTTPRequestOperation alloc] initWithRequest:request] autorelease]; -operation.completionBlock = ^ { - if ([operation hasAcceptableStatusCode]) { - NSLog(@"Friend Request Sent"); - } else { - NSLog(@"[Error]: (%@ %@) %@", [operation.request HTTPMethod], [[operation.request URL] relativePath], operation.error); - } -}; -[operation start]; -``` - ### Streaming Request ``` objective-c