Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RedditService service fails with 403 Blocked error #122

Open
gragra33 opened this issue May 19, 2023 · 0 comments
Open

RedditService service fails with 403 Blocked error #122

gragra33 opened this issue May 19, 2023 · 0 comments

Comments

@gragra33
Copy link

There is an easy fix for this, we need to add a 'User-Agent' header, something like below:

public interface IRedditService
{
    /// <summary>
    /// Get a list of posts from a given subreddit
    /// </summary>
    /// <param name="subreddit">The subreddit name.</param>
    [Headers("User-Agent: Awesome CommunityToolkit.Mvvm Sample App")]
    [Get("/r/{subreddit}/.json")]
    Task<PostsQueryResponse> GetSubredditPostsAsync(string subreddit);
}

Now the sample in the 'The Final Result!' will work correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant