1

InstaSharpを使用して、ユーザーの最新のメディア投稿を取得しようとしています。エラーが発生しています:

{"Exception has been thrown by the target of an invocation."}

これが私のコードです:

    public async Task<string> GetUserRecentMedia(string userId)
    {
        string response = string.Empty;
        try
        {
            InstagramConfig config = new InstagramConfig(ClientId, ClientSecret, RedirectUri, string.Empty);
            Users usersEndpoints = new Users(config);
            response = ConvertToJson(usersEndpoints.Recent(userId));
        }
        catch (Exception ex) { }
        return response;
    }
4

1 に答える 1

0

非同期メソッドでInstaSharpメソッドを呼び出す必要があります(行ったように)そして、呼び出したいメソッドを待ちます

await usersEndpoints.Recent(userId);
于 2016-01-29T09:37:41.853 に答える