'Steam API fetching empty response
I am using steam API for one of my projects, but the response from API is null/empty. It is working fine with Postman but in browser it is not.
API: http://api.steampowered.com/ISteamApps/GetAppList/v0001/
let apiInfo = async function() {
fetch(`http://api.steampowered.com/ISteamApps/GetAppList/v0001/`, {
method: 'GET',
mode: 'no-cors'
})
.then(response => { console.log(response); return response.text()})
.then((dataFromServer) => {
console.log(dataFromServer);
})
.catch(error => window.alert(error));
}
And my response looks like this:
Response {type: 'opaque', url: '', redirected: false, status: 0, ok: false, …}
body: null
bodyUsed: false
headers: Headers {}
ok: false
redirected: false
status: 0
statusText: ""
type: "opaque"
url: ""
[[Prototype]]: Response
The API fetches information about ID's associated with the games. Can anyone tell me what I am doing wrong or how can I make it work. Any help will be appreciated.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
