First, the bottom realization
1> AFN based on OC nsurlconnection and nsurlsession
2> ASI 's underlying cfnetwork framework based on pure C language
3> ASI has a higher operating performance than AFN
Ii. data processing for the return of the server
1> ASI does not provide direct data processing to the server, directly returns the data\string
2> AFN provides a variety of ways to process server data
* JSON Processing
* XML Processing
* Other processing
Third, the process of monitoring the request
1> AFN provides success and failure two blocks to listen for requests (only for success and failure)
* Success : Call after successful request
* failure : Call after request failed
The 2> ASI offers 3 solutions, each of which listens to the complete process of the request.
(Listener requests Start, receive response header information, receive specific data, accept, request failed )
* become an agent, abide by the agreement, implement the agent method in the Agreement
* Become an agent, do not comply with the protocol, custom proxy methods
* Set block
Iv. Ease of use in file downloads and file uploads
1> AFN
* not easy to listen to download progress and upload progress
* not easy to implement a breakpoint continuation
* Generally only used to download a small file
2> ASI
* Very easy to download and upload
* Very easy to listen to download progress and upload Progress
* Very easy to implement the breakpoint continued to pass
* Download or large or small files are OK
Five, ASI provides more practical functions
1> Control Circle do not relay in the request process
2> can easily set dependencies between requests : Each request is a nsoperation object
3> can manage all requests uniformly (also specifically providing a call to Asinetworkqueue to manage all request objects)
* Pause \ Resume \ Cancel all requests
* Monitor the download progress and upload progress of all requests in the entire queue
The difference between IOS ASI and AFN