afnetworking
Afnetworking is a delightful network library made for IOS and Mac OSX, built on top of the framework of the URL loading system, embedded in the cocoa, extending the powerful advanced network abstraction. Its modular architecture is well designed and has a rich range of functions, so it is certainly pleasing to use.
Original link https://github.com/AFNetworking/AFNetworking
Introduced
1. Support for HTTP requests and rest-based network services (including GET, POST, PUT, delete, etc.)
2. Support Arc
3. Requires iOS 5.0 and later
4.UIKit expansion
Configuration
1. Download the afnetworking and drag 2 folders: afnetworking and uikit+afnetworking into the project
2. Import the following library files: cfnetwork, Security, SystemConfiguration, mobilecoreservices
3. If you have previously used version 1.0, then Afnetworking 2.0 Migration Guide can help you
4. If you are configuring with Cocoapods, then
Platform:ios, ' 7.0 '
Pod "afnetworking", "~>2.0"
Use
1.HTTP Request operation
The common pattern of Afhttprequestoperationmanager encapsulation communicates with Web applications over HTTP, including creation of requests, response serialization, network accessibility monitoring, operational management and security, and requests.
GET request
POST request
POST request (multiple tables)
2.AFURLSessionManager (Nsurlsession Detailed network programming (6))
Creation and management of Nsurlsession objects Nsurlsessionconfiguration objects must be implemented <nsurlsessiontaskdelegate>, < Nsurlsessiondatadelegate>, <nsurlsessiondownloaddelegate>, <NSURLSessionDelegate> Agreement
Create a download task
Create an upload task
Create an upload task with multiple tables and progress
Create a dataflow data task
3. Network monitoring (usually with another network monitoring class, reachability, and JSON parsing method, anyway I also generally do not, self-brain repair)
The Afnetworkreachabilitymanager monitors the accessibility of the network domain, the Wwan address and the WiFi interface.
Current network status
HTTP Manager Accessibility
4.AFHTTPRequestOperation
Afhttprequestoperation is a subclass of Afurlconnectionoperation that uses the HTTP or HTTPS protocol.
The acquired HTTP state and type of the package it encapsulates will determine the success or not of the request. Although Afhttprequestoperationmanager is usually the best way to request it, afhttprequestopersion can also be used alone.
GET request
Bulk Multi-Request
Other information
1. Official website
2. English documents
IOS third-party open Source Library----->afnetworking