1
這裏是我的代碼:嘗試獲取Twitter的令牌
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://twitter.com/oauth/request_token?oauth_callback=http://musiclamhe.com&oauth_consumer_key=jxSd6mnfXZoijjB9LppvTZA&oauth_nonce=28dc0bec380eba99306b7ff256e7bc67&&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1389960513&oauth_version=1.0"]
cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData
timeoutInterval:100];
[request setHTTPMethod: @"GET"];
NSError *requestError;
NSURLResponse *urlResponse = nil;
NSData *response1 = [NSURLConnection sendSynchronousRequest:request returningResponse:&urlResponse error:&requestError];
NSLog(@"ooo %@",response1);
NSString *nss=[[NSString alloc]initWithData:response1 encoding:NSUTF8StringEncoding];
NSLog(@"ooo %@",nss);
它顯示了以下錯誤消息:
failed to validate oauth signature and token