30

I am about to develop an application for iPad and it has enormous amount of background thread network calls.

I would like to know which one will be better? ASIHTTPRequest still works but not maintained. However few sources says AFNetworking framework creates lots of complications.

TeaCupApp
  • 11,316
  • 18
  • 70
  • 150
  • 2
    See also here: http://stackoverflow.com/questions/7529258/what-major-asihttprequest-features-is-afnetworking-missing – borisdiakur Jan 06 '12 at 09:34

2 Answers2

52

Update (September 2013)

It's been nearly two years since I originally wrote this answer, and quite a lot has changed. AFNetworking is about to go into version 2.0 and has a thriving developer community, whereas ASIHTTPRequest is pretty much dead. Additionally, AFNetworking has dozens of great helper libraries and classes available for handling things like OAuth, Amazon S3, and the like. It's so popular that there's several books available on it.

Given this, there's no reason at all to keep using ASIHTTPRequest. My original answer is below, so if you're still interested do read on - just bear in mind I would now recommend without a doubt not using ASIHTTPRequest and going with something more modern (namely, AFNetworking, but other options are available).

Original Answer (December 2011)

How much time have you got? Here's my thoughts, although as a subjective question I don't think there's a right or wrong answer.

I lead a development team that works on commercial apps for sizeable clients, and some of my colleagues are always on the look-out for new libraries that can make things easier. Currently I guess the vast majority of our networking uses ASIHTTP. We took a look at AFNetworking about six months ago, and decided at the time we'd stick with what we know. ASI has been around for a while, and there is far more documentation and helpful advice available online for it. It is a solid codebase, and been around long enough to have gained a lot of traction and respect.

That said (and hopefully people who disagree with everything I've said above will read on!), I think if you're starting afresh now is the time to move on to something else. Even the developer of ASI thinks so. Given all of the changes that have come with iOS 5, I think a modern actively maintained framework like AFNetworking (and there are other options, like RestKit) is a good choice.

Now, you're right to say some people have trouble using AFNetworking in their application. But equally, a quick google reveals many people who had problems with ASI (valid or not)! I think whatever framework you go with, someone somewhere will have had trouble with it, either through something genuine wrong with the framework or their own limitations.

So with all this in mind I think I'd dive in to AFNetworking, and see how you get on! One of my new year resolutions will be to migrate over to a new networking library, and I think it will probably be AFNetworking.

From Author's Comment:

A little update: I've actually really enjoyed using AFNetworking, and in many ways it's considerably better (probably not the right word: 'refined', maybe) than ASI. That said, you shouldn't go into it expecting a 'like for like' replacement, and there are certain things you may want to consider other options for (Amazon S3, which ASI supported out of the box for example). But I'm generally really pleased, and find it a clear, well documented library. So if you're looking to move from ASI to something else, you really can't go wrong with AFNetworking...

Community
  • 1
  • 1
lxt
  • 31,146
  • 5
  • 78
  • 83
  • 2
    Nice write-up. A lot has changed about AFNetworking in the last 6 months. I think you'll like how the library has developed since you first looked at it :) – mattt Dec 28 '11 at 02:50
  • 8
    A little update: I've actually really enjoyed using `AFNetworking`, and in many ways it's considerably better (probably not the right word: 'refined', maybe) than ASI. That said, you shouldn't go into it expecting a 'like for like' replacement, and there are certain things you may want to consider other options for (Amazon S3, which ASI supported out of the box for example). But I'm generally really pleased, and find it a clear, well documented library. So if you're looking to move from ASI to something else, you really can't go wrong with AFNetworking... – lxt Jan 30 '12 at 19:35
  • 1
    I have made the exact same experience that lxt made as described in his long comment, AFNetworking has become solid and ready for big projects. – Till Aug 02 '12 at 18:41
  • 1
    AFNetworking has been selected to be the readers choice in Raywenderlich http://www.raywenderlich.com/21987/top-10-most-useful-ios-libraries-to-know-and-love – Anindya Sengupta Jun 04 '13 at 07:43
  • @AnindyaSengupta thnx for sharing the link :) – NightFury Jul 17 '13 at 05:17
  • AFNetworking doesn't support download speed throttle... ASI does – bikram990 Sep 20 '13 at 06:34
  • @bikram990 I would, at this point, highly recommend using `AFNetworking` over ASI. ASI has, in the nearly two years that have passed since I wrote this answer, pretty much died a death in terms of support. – lxt Sep 20 '13 at 09:12
  • @lxt I'm currently looking to change my code from using ASI to AFNetworking. But i need download speed throttling feature but couldn't find it in AFNetworking. As the files I'm suppose to download are going to be big and I don't want my application to use all bandwidth on the device. – bikram990 Sep 20 '13 at 10:40
  • My question is so old now lol...There are much libraries are out there...including native NSURLSession. :D – TeaCupApp Jul 04 '16 at 09:59
1

https://github.com/BoydYang/BYRequest BYRequest based on MKNetowrkKit, but it works like ASIHttpRequest, so you can easily migrate your project from ASIHttpRequest to BYRequest and also enjoy ARC.

user377808
  • 3,481
  • 2
  • 18
  • 12