【问题标题】:Could not authenticate you无法验证您的身份
【发布时间】:2011-03-19 11:21:34
【问题描述】:

消息下方是我的代码。但我收到了错误消息“无法验证您”

我该如何解决?

谢谢

-(IBAction)sendButtonTapped:(id)发件人{ NSString*message = [NSString stringWithFormat:@" %@。我是 %@ 并且对它有 %@ 的感觉。", notesField.text ? notesField.text :@"", [活动对象AtIndex:[tweetPicker selectedRowInComponent:0]], [感觉 objectAtIndex:[tweetPicker selectedRowInComponent:1]]]; NSLog(@"Twett buttone 点击"); //推特黑魔法 NSMutableURLRequest *theRequest=[NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://user name:password@twitter.com/statuses/update.xml"] cachePolicy:NSURLRequestUseProtocolCachePolicy 超时间隔:60.0]; [theRequest setHTTPMethod:@"POST"]; [theRequest setHTTPBody:[[NSString stringWithFormat:@"status=%@",message] dataUsingEncoding:NSASCIIStringEncoding]]; NSURLResponse* 响应; NSError* 错误; NSData* 结果 = [NSURLConnection sendSynchronousRequest:theRequest returnedResponse:&response error:&error]; NSLog(@"%@", [[[NSString alloc] initWithData:result encoding:NSASCIIStringEncoding] autorelease]); //结束推特黑魔法 }

【问题讨论】:

  • 您可以尝试删除状态参数吗?在 C# 项目中,我删除了 status 参数并且它可以工作

标签: iphone twitter


【解决方案1】:

要调用 twitter 网络服务 API,您必须使用 OAuth,阅读它here

【讨论】:

    猜你喜欢
    • 2011-08-04
    • 2013-11-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-15
    • 2021-04-14
    • 2019-05-18
    相关资源
    最近更新 更多