Ich erhalte ständig die Zone-Out-Antwort anstelle eines JSON?JavaScript

Javascript-Forum
Anonymous
 Ich erhalte ständig die Zone-Out-Antwort anstelle eines JSON?

Post by Anonymous »

Ich versuche, JSON-Daten daraus abzurufen: https://p1.ecom.samsung.com/v1/exchange ... 966BDBBEUB, aber ich bekomme nur Folgendes:

Code: Select all

Z {__zone_symbol__state: null, __zone_symbol__value: Array(0)}
__zone_symbol__state
:
null
__zone_symbol__value
:
[]
Symbol(Symbol.species)
:
(...)
Symbol(Symbol.toStringTag)
:
(...)
[[Prototype]]
:
Object
Ich habe stundenlang so viele Methoden ausprobiert, aber keine scheint zu funktionieren. Dies ist einer davon:

Code: Select all

async function getTradeInData() {
try{
const response = await fetch('https://p1.ecom.samsung.com/v1/exchange/api/gbr/trade-in/sku-devices/uk/SM-F966BDBBEUB',
{
method: 'GET',
headers: {
'Accept': 'application/json',
},
});

if(!response.ok){
throw new Error(`HTTP error! status: ${response.status}`);
}

const jsonResponse = await response.json();
const data = jsonResponse.data;

return data;

} catch(err){
console.error(err);
return null;
}
}

getTradeInData().then(data => console.log(data));
LÖSUNG: Es scheint, dass dieses Problem nur bei Microsoft Edge auftrat. Nachdem ich den Browser duckduckgo verwendet hatte, hatte ich keine Probleme.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post