What is AFN
The full name is afnetworking, is a layer of nsurlconnection, nsurlsession package
Although the operating efficiency is not ASI high, but the use is simpler than the ASI
In the development of iOS, the use of more extensive
AFN's GitHub Address
Https://github.com/AFNetworking/AFNetworking
|
Version |
for iOS version |
Xcode requirements |
|
2.0+ |
IOS 6.0+ |
Xcode 5.0+ |
|
1.x |
IOS 5.0 |
|
|
0.10.x |
IOS 4.3 |
|
Afhttprequestoperationmanager
is one of the most important objects in AFN .
Encapsulates the common processing of HTTP requests
Get\post Request
Parsing the server's response data
Create
Afhttprequestoperationmanager *mgr = [Afhttprequestoperationmanager manager];
GET Request-(Afhttprequestoperation *) GET: (NSString *) urlstring parameters: (ID) Parameters success: (void(^) (Afhttprequestoperation *operation,IDresponseobject)) Success Failure: (void(^) (Afhttprequestoperation *operation, Nserror *error)) FailurePOST request -(Afhttprequestoperation *) POST: (NSString *) urlstring parameters: (ID) Parameters success: (void(^) (Afhttprequestoperation *operation,IDresponseobject)) Success Failure: (void(^) (Afhttprequestoperation *operation, Nserror *error)) Failure
IOS AFN (third-party request)