Question

I became interested in this after reading the list of libraries used by Instagram:http://instagram.com/about/legal/libraries/ "The following sets forth attribution notices for third party software that may be contained in portions of the Instagram product. We thank the open source community for all of their contributions." And they list both AFNetworking and ASIHTTPRequest. I don't understand why. Is there some sort of back compatibility or what? As far as I know ASIHTTPRequest is dead for now. Can someone explain me possible reasons for this? Thanks

Was it helpful?

Solution

As Paul.s pointed in his comment the main reason is legacy code. First version of Instagram app was published in the App Store in 2010. And developing of AFNetworking was started in 2011. So in 2010 the de facto standard for networking code was ASIHTTPRequest and I think Instagram developers choose it. But Instagram is a fastly developed mainstream application with hundred of millions users (2014) which must continuosly update. ASIHTTPRequest is an outdated library for now and AFNetworking is the best library for network bound applications which is a successor of asihttp. I think Instagram developers switched to it fully now and just pointed ASIHTTPRequest in their libraries list because earlier they used it heavily.

OTHER TIPS

AFNetworking is being actively developed by Mattt Thompson. It is state of the art.

Here is the author's note on ASIHTTPRequest: "Please note that I am no longer working on this library - you may want to consider using something else for new projects. :)"

ASIHTTPRequest uses the CFNetwork framework, which is a lower-level framework than the NSURLConnection framework used by AFNetworking.

This provides a few advantages. One example is the ability to specify an HTTP proxy like so:

NSURL *url = [NSURL URLWithString:@"http://allseeing-i.com/ignore"];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setProxyHost:@"192.168.0.1"];
[request setProxyPort:3128];

It is impossible to specify an HTTP proxy with AFNetworking, because NSURLRequest doesn't support it.

I won't rehash all of the differences, since most of the benefits are outlined in their documentation.

As Zaph notes, ASIHTTPRequest has not been updated in ages. AFNetworking is vastly superior in most respects.

Summary: if you're not sure, use AFNetworking.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top