There’s always been a lot of talk about using libCurl for web communications on the iOS platform with it’s vast protocol support and wide number of communications options.
Bruno de Carvalho has released a library called BBHotPotato that utilizes libCurl providing a nice concise syntax for your HTTP communication needs along with a build script so you can build your own static libCurl library for easy inclusion in your iOS projects.
Here’s an example of how you could use BBHotPotato to create a JSON request:
NSLog(@"User email: %@", result[@"user.email"]);
NSLog(@"# of followers: %@", result[@"user.followers.@count"]);
} error:^(NSError* error) {
// Handle request *or* JSON decoding error
}];
Using libCurl also allows you to avoid some errors that can occur when uploading with NSURLConnection. As Bruno stats in the BBHotPotato readme:
the motivation for this libcurl wrapper was that during development of Droplr’s API server, we noticed that whenever the API rejected an upload and immediately closed the connection — which is a perfectly legal & reasonable behavior — the Cocoa-based clients would keep reporting upload progress (even though I knew the socket was closed) and eventually fail with “Request timeout”, instead of the response the server had sent down the pipes.
You can find BBHotPotato on Github here.
You can find the build scripts allowing you to easily create a libCurl static library for iOS devices on Github here.
A great library and build script for those wanting to use libCurl within an iOS project.
- Open Source Core Text Wrapper Simplifies Multi-Column Text Display (and more)
- Open Source: Library For Easy USB And TCP Communication Within iOS/Mac Apps
- News: Face-To-Face In iOS App Video Library Released With Free Licensing Option
- Open Source Wrapper Makes It Easier To Use OpenGL ES 2.0 In Objective-C
- Open Source: New Networking Framework Inspired By The Now Defunct ASIHttpRequest
Original article: Easy To Use Objective-C Wrapper For The LibCurl Web Communications Library
©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.





