Reputation: 1294
Please any one help to make cURL call of below url
curl -u "demo:demo" -H "Accept: application/json" http://api.holdsport.dk/v1/teams
it would really helpful for me to continue my project. demo:demo is username and password
Thanks.
Upvotes: 2
Views: 3029
Reputation: 16827
The libcurl project which cURL is based on is C based and will run perfectly fine as C is an Objective-C subset (many examples here). Although if you are targeting Cocoa/Cocoa Touch only, then the NSURLConnection classes (or higher-level ASIHTTPRequest or AFNetworking third party libraries) would be very much easier (with asynchronous handling out of the box).
EDIT: Actually if you really want to use cURL, there are Cocoa bindings for it.
Upvotes: 3
Reputation: 21830
This is how I've seen http requests made
//Create a new url request with our url path
myRequest_ = [[ASIHTTPRequest alloc]initWithURL:[NSURL URLWithString:URL_PATH]];
myRequest_.delegate = self;
//send out the request as asynchronous
[myRequest_ startAsynchronous];
Upvotes: 0