Clash Royale API request with pure JS

0

I'm trying to make a request from the Clash Royale API ( link )

Returns the following error:

Access to fetch at 'https://api.clashroyale.com/v1/players/%23C8Q2QR08' from origin 'https://deckroyale.now.sh' has been blocked by CORS policy: Request header field auth is not allowed by Access-Control-Allow-Headers in preflight response.

I always return a CORS policy error, until I put "mode": "no-cors", it returns empty with error 403.

Does anyone have a solution? NOTE: I'm using JavaScript fetch

    
asked by anonymous 27.12.2018 / 04:57

0 answers