CommunityToolkit / CommunityToolkit/MVVM-Samples

RedditService service fails with 403 Blocked error

Open
#122 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
1.4k
Forks
265
PR merge metrics
No merged PRs in 30d

Description

There is an easy fix for this, we need to add a 'User-Agent' header, something like below:
```csharp
public interface IRedditService
{
///
/// Get a list of posts from a given subreddit
///
/// The subreddit name.
[Headers("User-Agent: Awesome CommunityToolkit.Mvvm Sample App")]
[Get("/r/{subreddit}/.json")]
Task GetSubredditPostsAsync(string subreddit);
}
```
Now the sample in the 'The Final Result!' will work correctly.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.