Calling REST web services is simple enough - I use the native NSURLConnection class and its delegate methods:
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"webServiceURL"]];
[request setHTTPMethod:@"GET"];
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
But how do I pass object parameters to the call? For instance, if the web service expects an object UserInfo { name:string, age:int}.
Now this call only has two parameters - I'm also thinking of possible cases where I might have to pass many more in the request.
What's the right way to do this? I've heard of RestKit and plan to try it soon, but is there any good way without third party libraries?
[request setValue:@"user1" forHTTPHeaderField:@"username"];but the REST Web API doesn't recognize the parameters passed.