我正在尝试获取iOS应用中的Twitter粉丝数量。
我找到了一些有关此问题的文档: https://dev.twitter.com/rest/reference/get/users/lookup
这是我到目前为止的代码:
NSString *apiURLString = [NSString stringWithFormat:@"https://api.twitter.com/1.1/users/lookup.json?screen_name=%@", @"barackobama"];
NSURL *apiURL = [NSURL URLWithString:apiURLString];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:apiURL];
request.HTTPMethod = @"GET";
NSOperationQueue *queue = [[NSOperationQueue alloc] init];
[NSURLConnection sendAsynchronousRequest:request queue:queue completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
// ((NSHTTPURLResponse *)response).statusCode
NSLog(@"response = %@", response);
}];
但是,我很担心如何发送请求所需的所有其他参数。
提前致谢!