Fetch API ile JSON Veri Çekme

Listeye Dön

Açıklama

Modern tarayıcılarda XMLHttpRequest yerine kullanılan, asenkron veri çekme (API) yönteminin en temel kullanımı.
JavaScript SOURCE CODE
fetch("https://jsonplaceholder.typicode.com/users")
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error("Hata:", error));
Çıktı
Kodu çalıştırmak için ▶ butonuna tıklayın.