AFNetworking, MKNetworkKit, and ASIHTTPRequest, mknetworkkit
I have been using ASIHTTPRequest as the network library before, but since it stops updating, there may be more problems on iOS7, so I decided to change the network library.
Currently, the most popular network libraries are AFNetworking and MKNetworkKit. After some google operations, the comparison between the three libraries is as follows:
| |
AFNetworking |
MKNetworkKit |
ASIHTTPRequest |
| Update Status |
Relatively large number of maintenance and users |
Relatively few maintenance personnel and users |
Stop update |
| Supports iOS and OSX |
Yes |
Yes |
Yes |
| ARC |
Yes |
Yes |
No |
| Resumable upload |
No, you can use AFDownloadRequestOperation |
Yes |
Yes |
| Synchronous asynchronous request |
Only asynchronous |
No |
Yes |
| Image cached locally |
No, through SDURLCache or AFCache |
No |
No |
| Image cache to memory |
Yes |
Yes |
No |
| Background download |
Yes |
Yes |
Yes |
| Download progress |
No, you can use AFDownloadRequestOperation |
Yes |
Yes |
| Cache offline requests |
No, through SDURLCache or AFCache |
Yes |
No |
| JSON, XML |
Yes |
Yes |
No |
According to the above comparison, although AFNetworking is weaker than MKNetworkKit, it has higher scalability and more maintainers, which is better than MKNetworkKit in the long term.
The above comparison is based on my own testing and data query. If any of the above is incorrect, I hope you can point it out. Thank you!