Twitter oauth issue with frindship / create in api

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];


//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);
       }

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>
0
source share
1 answer

, 5 , , / , .

0

Source: https://habr.com/ru/post/1769007/


All Articles