Is RESTKit a good replacement for ASIHTTPRequest?
Asked Answered
S

3

14

I have been using ASIHTTPRequest for quite a while now and i quite satisfied with it. However since it has been deprecated, I am considering replacing it. My first though was to go with the NSURLConnection, but I found out that ASIHTTPRequest actually does quite a lot. For example I like its queue handling.

The iPhone application that I am working on uses a REST API, so I have been considering RESTKit. Is is possible to use RESTKit without Core Data? As it is know I have pure dataobjects and I do not want to use Core Data, not right now anyway.

Are there any other good alternatives to ASIHTTPRequest?

BTW I know that there is a similar question but this is more specific.

Swirsky answered 19/1, 2012 at 7:12 Comment(5)
allseeing-i.com/%5Brequest_release%5D the author of ASIHTTPRequests give some options. Personally I like AFNetworking.Shoshana
What are the benefits of AFNetworking?Swirsky
Are there any good tutorials for AFNetworking?Swirsky
Completely self serving but: I wrote these classes as a replacement for the GET and POST parts of ASIHTTPRequest github.com/tonymillion/TMHTTPRequestPolymorphism
Tony Million; I will take a look at your classes. You wrote your comment when I wrote mine.Swirsky
R
7

I can definitely recommend RestKit, I make use of it a lot! It handles common stuff for you and no, you don't have to use Core Data. RestKit can work with it, but that is just a nice feature. A good starting point for using RestKit is the wiki on github.

RestKit relies on AFNetworking as a networking framework. If RestKit seems to be an overkill, you may want to try only this one.

Rhizocarpous answered 19/1, 2012 at 7:32 Comment(6)
I did not get the RestKit working the way I wanted. There was a lot of trouble and in the end it did not work properly.Swirsky
Dealing with RestKit shouldn't cause any problems - if so, you are probably misunderstanding some concepts. You could provide some details (what you wanted to do, what went wrong) to solve your problems with RestKit.Rhizocarpous
There was some missing features. For example the object mapping did handle all the special cases we needed for our current implementation. Also tried to use RestKit without object mapping, but ran into other problems, like the application hanging. I have been discussing these issues in the RestKit Google discussion group. I spent many days to get things working with RestKit. I did not have time to wait. So I was forced to try another solution. I must point out that I believe that RestKit is a good library. But for me it was not mature enough. I will keep an eye on RestKit and try it again.Swirsky
For some people the RestKit may be a better solution than AFNetworking. But I ended up using AFNetworking. I am only trying to be honest here.Swirsky
I put this back as the correct answer, since my question really was about RestKit as a replacement for ASIHTTP. But as mentioned, AFNetworking and the current implementation turned out to match better.Swirsky
Just wanted to chime in and say that RestKit has been an incredibly useful tool for me in the various apps I've developed with it. There is definitely a learning curve, but once you get over that hump it really enables you to develop powerful apps in much shorter timespans while massively reducing your codebase. There are sometimes some mapping issues, but IMO that is often due to structural issues with the APIs that are being consumed more than RestKit's fault. Along with SDWebImage it's a very powerful toolset.Mochun
S
26

I think that AFNetworking is a good solution.

Pros:

  • Small
  • Well documented
  • Simple to install, only copy the source code into your project.
  • Simple to use.
  • An excellent category for UIImageView for loading icons in the background.

Cons:

  • No way of setting the timeout for requests. (Applies to v0.9.0)
Swirsky answered 27/1, 2012 at 13:43 Comment(3)
+1 AFNetworking works on both MacOS and iOS.. so one learning curve => more platform benefits.Jumpy
+1, AFNetworking is so much easier and cleaner to get working correctly than RestKit. I am sure there are some situations where RestKit is warranted, but for anyone who is just trying to get some fairly basic webservice communication going AFNetworking is a much better choice.Fluffy
RestKit is an overkill even if you want to use Core Data (I had to use it in multiple applications, run away from it). <3 AFNetworking <3 AlamofireInflict
R
7

I can definitely recommend RestKit, I make use of it a lot! It handles common stuff for you and no, you don't have to use Core Data. RestKit can work with it, but that is just a nice feature. A good starting point for using RestKit is the wiki on github.

RestKit relies on AFNetworking as a networking framework. If RestKit seems to be an overkill, you may want to try only this one.

Rhizocarpous answered 19/1, 2012 at 7:32 Comment(6)
I did not get the RestKit working the way I wanted. There was a lot of trouble and in the end it did not work properly.Swirsky
Dealing with RestKit shouldn't cause any problems - if so, you are probably misunderstanding some concepts. You could provide some details (what you wanted to do, what went wrong) to solve your problems with RestKit.Rhizocarpous
There was some missing features. For example the object mapping did handle all the special cases we needed for our current implementation. Also tried to use RestKit without object mapping, but ran into other problems, like the application hanging. I have been discussing these issues in the RestKit Google discussion group. I spent many days to get things working with RestKit. I did not have time to wait. So I was forced to try another solution. I must point out that I believe that RestKit is a good library. But for me it was not mature enough. I will keep an eye on RestKit and try it again.Swirsky
For some people the RestKit may be a better solution than AFNetworking. But I ended up using AFNetworking. I am only trying to be honest here.Swirsky
I put this back as the correct answer, since my question really was about RestKit as a replacement for ASIHTTP. But as mentioned, AFNetworking and the current implementation turned out to match better.Swirsky
Just wanted to chime in and say that RestKit has been an incredibly useful tool for me in the various apps I've developed with it. There is definitely a learning curve, but once you get over that hump it really enables you to develop powerful apps in much shorter timespans while massively reducing your codebase. There are sometimes some mapping issues, but IMO that is often due to structural issues with the APIs that are being consumed more than RestKit's fault. Along with SDWebImage it's a very powerful toolset.Mochun
S
0

Try the 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. https://github.com/BoydYang/BYRequest

Surly answered 6/12, 2012 at 1:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.