Reputation: 423
Simple one here. In GTM-OAuth 2.0 how do I send multiple post parameters? Here is how I post data now:
NSString *postString = [NSString stringWithFormat:@"i=%@",articleIndex];
[myFetcher setPostData:[postString dataUsingEncoding:NSUTF8StringEncoding]];
My question is how to send multiple parameters like i=1&t=2? is it like this?
Thank you!
Upvotes: 0
Views: 212
Reputation: 1564
It's just a different format string, like
NSString *postString = [NSString stringWithFormat:@"i=%d&t=%d", i, t];
Another common technique is to put parameters pairs as strings like @"i=1"
into an NSArray, and use NSArray's joining method, [array componentsJoinedByString:@"&"]
, to make the full string.
Upvotes: 0