I’m trying to fetch a subreddit RSS feed from my Go application but I get the response code “403 Forbidden” every time and a message to contact support through email.

The weird thing is the request works if I do it directly in an HTTP client

User-Agent: MyRssClient/1.0 (Operated by BurnInNoia)

But using Go it fails with the message:

If you’re supplying an alternate User-Agent string, try changing back to default as that can sometimes result in a block.

req, _ := http.NewRequest(http.MethodGet, url, nil)
req.Header.Set("User-Agent", "MyRssClient/1.0 (Operated by BurnInNoia)")
resp, err := u.client.Do(req)

Does anyone have done it before?

Source link

By Ajay Kumar Verma

techopenion is the one stop solution of all your information needs. Get everything from latest tech updates to latest gadgets in technology.

Leave a Reply

Your email address will not be published. Required fields are marked *