/ Published in: Objective C

Expand |
Embed | Plain Text
if ([aDictionary count] > 0) { initWithURL:[aRequest URL]]; [request setHTTPMethod:@"POST"]; for (int i = 0; i < [allKeys count]; i++) { [postString appendFormat:( (i == 0) ? @"%@=%@" : @"&%@=%@" ), key, value]; } [request setHTTPBody:[postString dataUsingEncoding:NSUTF8StringEncoding]]; [postString release]; postString = nil; [request release]; request = nil; return YES; } else { return NO; } } // --------------------------------------------- // usage // Send name=Mark&lastname=Smith initWithObjectsAndKeys: @"Mark", @"name", @"Smith", @"lastname", nil]; [self connectionPOST:request withParams:params]; [params release]; params = nil;
Comments

You need to login to post a comment.
Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me. click this link here now