Call a RESTFul API - GitHub

Shows how to make an AJAX call to a RESTFul API.

HTML

<div>Imperator109: <div id="results" style="background: lightblue;"></div></div>

JavaScript

fetch('https://jsonplaceholder.typicode.com/todos/1')
  .then(response => response.json())
  .then(json => document.getElementById('results').innerHTML = (json.title + ', cośtam.id===' + json.id))