ASIHTTPRequest vs AFNetworking vs NSUrlRequest

William Falcon picture William Falcon · Mar 30, 2013 · Viewed 18.6k times · Source

In the past I have use ASIHTTPRequest but now there is NSURLRequest. Should we be using the NSURLRequest now? Are there any disadvantages?

For people reading this now: I ended up using AFNetworking as mentioned in the answers

https://github.com/AFNetworking/AFNetworking

Thanks,

Answer

Rob picture Rob · Mar 30, 2013

NSURLConnection and NSURLRequest are the provided Cocoa classes for managing connections. In iOS 7, Apple added NSURLSession.

But I think you'll find AFNetworking to be a framework that further simplifies network requests (notably complex HTTP requests). If you don't want to use third-party frameworks for any reason, you can use NSURLConnection and/or NSURLSession directly. It just takes a little more coding.

If you're looking for a good ASIHTTPRequest alternative, AFNetworking is a great candidate.

For information on NSURLConnection and NSURLSession see the URL Loading System Programming Guide.