做一个类新浪微博的客户端,抓取数据时,可以获取用户的个人信息,但是在抓取关注的人的微博时返回fail,把错误打印出来,字面上看是权限不够,但是个人觉得应该不会,这是微博公开的接口,求分析。
以下是代码部分
NSString *str = [NSString stringWithFormat:@"https://api.weibo.com/2/statuses/friends_timeline.json?access_token=%@",[AccountTool sharedAccountTool].currentAccount.accessToken];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:str]];
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
NSLog(@"成功 %@",JSON);
} failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) {
NSLog(@"失败--%@--%@--%@",request,response,error);
}];
[operation start];
以下是代码部分
NSString *str = [NSString stringWithFormat:@"https://api.weibo.com/2/statuses/friends_timeline.json?access_token=%@",[AccountTool sharedAccountTool].currentAccount.accessToken];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:str]];
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
NSLog(@"成功 %@",JSON);
} failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) {
NSLog(@"失败--%@--%@--%@",request,response,error);
}];
[operation start];