how did we call apis before fetch code example
Example: How to use fetch api
async function fetchText() {
let response = await fetch('/readme.txt');
let data = await response.text();
console.log(data);
}Code language: JavaScript (javascript)