【发布时间】:2013-09-25 21:27:08
【问题描述】:
我写了以下代码:
NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1.1/users/show.json"];
NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:username, @"screen_name" ,[[controller.engine accessToken] secret]];
TWRequest *request = [[TWRequest alloc] initWithURL:url parameters:params requestMethod:TWRequestMethodGET];
[request performRequestWithHandler:
^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {
if (responseData) {
NSDictionary *user = [NSJSONSerialization JSONObjectWithData:responseData
options:NSJSONReadingAllowFragments
error:NULL];
NSString *profileImageUrl = [user objectForKey:@"profile_image_url"];
NSLog(@"%@",profileImageUrl);
}
}];
但我总是会收到 Bad authentication 错误。我觉得我错过了什么。有人请检查我的代码吗?或者提供任何关于检索 twitter 用户个人资料图片的建议?
谢谢
【问题讨论】:
-
@Romit 查看我的回答
标签: ios authentication twitter