I am using the Google Data API Touch Application, which is available at code.google ....
I have a problem if anyone can help.
Please tell me if I am doing something wrong.
The user who is logged in must follow the XYZ person (just using XYZ for security).
I am using URL
urlStr = @"http://api.twitter.com/1/friendships/create/XYZ.xml";
NSURL *url = [NSURL URLWithString:urlStr];
NSMutableURLRequest *request = [NSMutableURLRequest
requestWithURL:url];
[request setHTTPMethod:@"POST"];
ConnectAppDelegate *appDelegate = (ConnectAppDelegate *)
[[UIApplication sharedApplication] delegate];
[mAouth authorizeRequest:request];
NSError *error = nil;
NSURLResponse *response = nil;
NSData *data = [NSURLConnection sendSynchronousRequest:request
returningResponse:&response error:&error];
if (data) {
NSString *str = [[[NSString alloc] initWithData:data
encoding:NSUTF8StringEncoding] autorelease];
NSLog(@"API response: %@", str);
} else {
NSLog(@"API fetch error: %@", error);
}
In response, I get
http://api.twitter.com/1/friendships/create/XYZ.xml
2010-06-11 16: 04: 39.437 Connect the response [4265: 20b] API:
<?xml
version="1.0" encoding="UTF-8"?>
<hash>
<request>/1/friendships/create/XYZ.xml</request>
<error>Invalid / used nonce</error>
</hash>
Ameya source
share