What is the difference between ASI and AFN?
1. Performance (Focus)
* ASI based on the underlying cfnetwork framework
* AFN based on nsurlconnection
* Operating performance: ASI > ASN
2. Processing server data
1> AFN: Automatic parsing based on data returned by the server
* The server returns JSON data, automatically converted to nsdictionary or Nsarray
* The server returns XML data and is automatically converted to Nsxmlparser
2> ASI: Does not parse the server data, directly returns the NSData binary data
3. Process of processing requests
1> afn:success and failure two blocks
2> ASI: There are 3 ways to handle the request process (proxy method \sel\block)
Features of 3.ASI (emphasis)
1> Cache
2> Download and upload
* Easy monitoring of Request progress
* Easy to implement breakpoint download (ASI does not have breakpoint upload function, breakpoint upload to use socket technology)
3> provides a number of expansion interfaces (such as data compression)
* ASIDataCompressor.h
* ASIDataDecompressor.h
4> asihttprequest inherit from Nsoperation
* All requests can be managed uniformly by queue
* Requests can depend on each other
5> Asinetworkqueue
* Unified management of all requests
* 5 downloads \ Upload Request-Asinetworkqueue: Monitor total progress of 5 requests
* Listen for all requests start \ Fail \ Complete
* Shouldcancelallrequestsonfailure
YES: A request in the queue failed and all other requests were canceled
No: One of the requests in the queue failed, the other requests are not affected, and the request continues
Features of 4.AFN
1> Easy to use
2> comes with a network monitoring function
What is the difference between the ASI and AFN iOS (2)