i’m trying to post tweet with twitter integration in iPhone.i’m facing some problem
here is my code:
//consumer= [[OAConsumer alloc] initWithKey:kOAuthConsumerKey secret:kOAuthConsumerSecret];
NSString *trimmedText=[NSString stringWithFormat:@"%@",tweetText.text];
NSURL *url=[NSURL URLWithString: @"https://api.twitter.com/1/statuses/update.json"];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObject:trimmedText forKey:@"status"];
NSLog(@"params=%@",[params objectForKey:@"status"]);
//NSString *body = [self _queryStringWithBase:nil parameters:params prefixed:NO];
NSData* requestData = [[params objectForKey:@"status"]dataUsingEncoding:NSASCIIStringEncoding];
NSLog(@"requestData=%@",requestData);
OAMutableURLRequest *request = [[[OAMutableURLRequest alloc] initWithURL:url consumer:consumer token:accessToken realm: nil signatureProvider: nil] autorelease];
[request setHTTPMethod:@"POST"];
//[request setHTTPBody:requestData];
OADataFetcher *fetcher = [[OADataFetcher alloc] init];
[fetcher fetchDataWithRequest:request
delegate:self
didFinishSelector:@selector(didReceiveAccessToken:data:)
didFailSelector:@selector(didFailOAuth:error:)];
now it’s showing error like: httpbody={“error”:“Client must provide a ‘status’ parameter with a value.”,“request”:"/1/statuses/update.json"}.
when i uncomment that [request setHTTPBody:data] it showing error index 1 beyond bound[0…0]
can u please help i’m new to this development