code.google... で入手できる Google Data API サンプル タッチ アプリケーションを使用しています。
私は誰でも助けることができる問題を抱えています。
何か間違ったことをしている場合は教えてください。
ログインしたユーザーは、誰か XYZ をフォローする必要があります (セキュリティ上の目的で XYZ を使用しているだけです)。
URLを使用しています
urlStr = @"http://api.twitter.com/1/friendships/create/XYZ.xml";
NSURL *url = [NSURL URLWithString:urlStr];
NSMutableURLRequest *request = [NSMutableURLRequest
requestWithURL:url];
//made post as requested in twitter API
[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) {
// API fetch succeeded
NSString *str = [[[NSString alloc] initWithData:data
encoding:NSUTF8StringEncoding] autorelease];
NSLog(@"API response: %@", str);
} else {
// fetch failed
NSLog(@"API fetch error: %@", error);
}
私が得る応答で
http://api.twitter.com/1/friendships/create/XYZ.xml 2010-06-11 16:04:39.437 Connect[4265:20b] API 応答:
<?xml
version="1.0" encoding="UTF-8"?>
<hash>
<request>/1/friendships/create/XYZ.xml</request>
<error>Invalid / used nonce</error>
</hash>