开发者

What are differences between NSURLConnection and ASI-HTTP-Request?

开发者 https://www.devze.com 2023-02-02 06:19 出处:网络
Some people strongly prefer asihttprequest ASIHTTPRequest vs NSURLConnection Reasons can be listed (not full)

Some people strongly prefer asihttprequest ASIHTTPRequest vs NSURLConnection

Reasons can be listed (not full)

  • a lot of extra features,such as supporting cache,http proxy etc
  • also based on CFNetwork , coming from ImageClient

But also there are a lot of bu开发者_如何学JAVAgs. NSURLConnection and NSHttpConnection are from iOS SDK, maybe have fewer bugs.

From ASIHTTPRequest vs NSURLConnection we can see that asihttprequest does not have better performance than nsurlconnection.

A very good paper Accessing The Cloud From Cocoa Touch

So question here is what differences do you think more ?

And what is your consideration to choose ?


Your link is comparing an very old version of ASIHTTPRequest - http://allseeing-i.com/ASIHTTPRequest-1.5 has more recent stats.

I'm finding it difficult to say much without repeating much of what I already said on ASIHTTPRequest vs NSURLConnection.

I've seen bugs in both NSURLConnection and ASIHTTPRequest; the advantage of ASIHTTPRequest was that I could fix the bugs in it! (Ben is good at merging in fixes to the mainline, and also very good at fixing bugs reported to him - though I have yet to take advantage of the latter :-) ).

Depending on your app, you may also have to write a lot of code on top of NSURLConnection if you decide to use it (eg. if you need caching), going through the full design/code/test/debug cycle - or you can use ASIHTTPRequest, which has a built in caching layer that's already been tested & debugged.

I think I'd look at the question a different way: If you use ASIHTTPRequest, you have an awful lot of flexibility and power available to you - is there any good reason to build an app using NSURLConnection?

0

精彩评论

暂无评论...
验证码 换一张
取 消