Flutter Dio Google News RSS feed return 403

42 Views Asked by At

Using flutter web platform I am trying to get google news rss feed from this link and show it as a news page on website.

https://news.google.com/rss/search?q=ev%20charger&hl=en-GB&gl=GB&ceid=GB:en

Here is how i tried with dio

 final response = await _dio.request(
    'https://news.google.com/rss/search?q=ev%20charger&hl=en-GB&gl=GB&ceid=GB:en',
    options: Options(
      method: 'GET',
    ),
  );

  return RssFeed.parse(response.data);

and

  final response = await _dio.get(
    'https://news.google.com/rss/search?q=ev%20charger&hl=en-GB&gl=GB&ceid=GB:en',
  );

  return RssFeed.parse(response.data);

No mater how i try its giving me 403 and CORS. If you try this link on browser or postman it works fine. Priority is to fix this 403 error. I also tried attaching different headers but result is always the same. I also noted that the result was successful twice yesterday with the same method and then again 403. Flutter inapp_webview is not an option because google news doesn't allow embeding.

0

There are 0 best solutions below