5 Replies
NIMA
NIMA3mo ago
hello anyone know what is problem with this ? i was use this api but it give me error what is the problem
glutonium
glutonium3mo ago
CORS policy
if the server is yours then,
- you need to install the npm cors package and enable it as the middleware
if server is not yours
- cant do anything
NIMA
NIMA3mo ago
its not mine its steam api
Chris Bolson
Chris Bolson3mo ago
You can try something like this
let response = await fetch('https://url', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
mode: 'cors',
credentials: 'same-origin'
});
let response = await fetch('https://url', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
mode: 'cors',
credentials: 'same-origin'
});
13eck
13eck3mo ago
It’s entirely possible that the API can only be called from a server and not the front end. Many API services do this to prevent people from leaking their credentials
Want results from more Discord servers?
Add your server