0

Summary

I am building a website(react app) integrated with twitch helix api.

I use the Implicit grant flow to auth my website

When request this https://api.twitch.tv/helix/videos route with game_id query param, it will always return an empty array

a picture from edge browser's network and console I printed enter image description here enter image description here

And the other routes are works fine.
like this route https://api.twitch.tv/helix/games/top enter image description here or same route with id query param https://api.twitch.tv/helix/videos enter image description here

BUT I use the api tester like Thunder Client for VS Code.
The https://api.twitch.tv/helix/videos works fine enter image description here

Also used the C# NET6 ConsoleApp to test on my windows 11 enter image description here

Found that this https://api.twitch.tv/helix/videos route only works on server side, the client side could not works.

Only this https://api.twitch.tv/helix/videos route with game_id query param return an empty array while others (same api with different route or same route with other query param) works fine, it seems this is not a CORS error

Tried Solution

Had tried this CORS - Wrong ‘Access-Control-Allow-Origin’ header on twitch developer forums to add a request header 'accept': 'application/vnd.twitchtv.v5+json', or renew my twitch developer console's clientId.
But still didn't work


My website on vercel

Does anyone know this issue or I am missing something?


1

1 Answer 1

1

Try set language request header to a empty string:

headers.set('accept-language', '')

It worked for me.

1
  • It works!! thanks for your help. I have worked on this for weeks.......LOL Commented Sep 23, 2022 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.