Reputation: 528
For an app i'm currently making i use the ASIHTTPRequest API to do my communication:
NSURL *url = [NSURL URLWithString:@"http://testService.com"];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request appendPostData:[jsonString dataUsingEncoding:NSUTF8StringEncoding]];
[request addRequestHeader:@"Content-Type" value:@"application/json"];
[request setTimeOutSeconds:20.0f];
[request setRequestMethod:@"POST"];
NSData * postData = [NSJSONSerialization dataWithJSONObject:dictionnary2 options:0 error:nil];
[request setPostLength:[postData length]];
[request appendPostData:postData];
[request setDelegate:self];
[request startAsynchronous];
i already have working calls in place but they both go to the same callback method :
- (void)requestFinished:(ASIHTTPRequest *)request
I want each call to have it's own callback method since i call one call from the callback method of the other. How can i do this ?
Upvotes: 0
Views: 398