AFNetworking 3.x what is the difference between AFHTTPSessionManager and AFURLSessionManager?

I am going to upgrade AFNetworking from 1.x to 3.x. My question is what is different from AFHTTPSessionManager and AFURLSessionManager ? and when to use each? Which one supports both XML and JSON request and response? Thanks

+6
source share
1 answer

Usually you use the AFHTTPSessionManager if you want to make GET or POST requests, which may include preparing JSON requests or x-www-formurlencoded or parsing complex answers. You can leave with the AFURLSessionManager if you are making very simple requests for which you do not need any additional AFHTTPSessionManager .

The bottom line, AFHTTPSessionManager is just a subclass of AFURLSessionManager with richer creation of complex queries and / or parsing of complex responses. Based on your question (parsing XML and JSON responses), AFHTTPSessionManager is what you want to use.

+8
source

All Articles