我正在使用 Linq To Twitter 并在尝试获取关注者时遇到异常。下面是我的代码和异常。
private static async Task<List<TwitterData>> GetTwitterFollowers(
ulong twitterUserId, SingleUserAuthorizer auth, int? maxFollowers)
{
var follower = maxFollowers ?? 15000;
try
{
var twitterCtx = new TwitterContext(auth);
var followers = await twitterCtx.Friendship
.Where(f => f.Type == FriendshipType.FollowersList
&& f.UserID == twitterUserId.ToString())
.Select(f => new TwitterData()
{
Followers = f.Users.Where(t => !t.Protected).Take(follower).Select(s => s).ToList()
}).FirstOrDefaultAsync();
return GetFollowersList(followers.Followers, ref twitterCtx);
}
catch (Exception ex)
{
return null;
}
}
例外
InnerException = {"The remote name could not be resolved: 'api.twitter.com'"}
请建议