5 Replies
NIMA
NIMAOP4mo ago
hello anyone know what is problem with this ? i was use this api but it give me error what is the problem
glutonium
glutonium4mo 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
NIMAOP4mo ago
its not mine its steam api
Chris Bolson
Chris Bolson4mo 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
13eck4mo 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