2

In my iPhone app, I use ASIHTTPRequest API to make cURL based http requests. I heard that this API is not being maintained and some times it crashes the app. I need to go with some other API where I can make cURL requests to my RESTful API which gives JSON as response.

Can any one suggest me that what is best alternative to ASIHTTPRequest to use in my production app?

satyanarayana
  • 265
  • 4
  • 14

3 Answers3

5

A really good alternative to ASIHTTPRequest is AFNetworking. There are good tutorials about how to integrate AFNetworking into your code, below you will find one. http://www.raywenderlich.com/30445/afnetworking-crash-course

varun thomas
  • 357
  • 4
  • 14
  • Can I make url authentication by sending app id, app secret and access token to a RESTful API along with POST data? I can do – satyanarayana Apr 18 '13 at 10:47
  • I can authenticate URL with ASIHTTPRequest as ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:@"http://myhost.com/api/login/format/json"]]; request.username = @"appidhere"; request.password = @"appsecret"; [request setDelegate:self]; [request setPostValue:@"usernamehere" forKey:@"username]; [request setPostValue:@"xxxx" forKey:@"pass"]; [request setPostValue:@"accesstokenvalue" forKey:@"X-API-KEY"]; How can I do this with AFNetworking? – satyanarayana Apr 18 '13 at 10:56
  • @satyanarayana Yes you can very well do that with AFNetworking actually they have blocks to help you with. below you will find the link to the answer http://stackoverflow.com/questions/7623275/afnetworking-post-request – varun thomas Apr 18 '13 at 11:32
2

You can use RestKit its a powerful library that enable u to get ur data from webservice and you can cache it store it local DB and map your json into objects to be used directly ....

MhammedMohie
  • 312
  • 2
  • 9
0

Try this one, it really simplifies the HTTP requests, and also comes with handy testing helpers

https://github.com/BadChoice/RVHttp

Jordi Puigdellívol
  • 1,710
  • 3
  • 23
  • 31