Multiple variants are presented: 2 variants. 1 via XMLHttpRequest without async/await. 1 via XMLHttpRequest with async/await. 1 variant. 1 via fetch with async/await. Note: for the XMLHttpRequest (non-async) example, the 'onreadystatechange' callback function is typically called 3 times, with statuses 2 then 3 then 4. Note: the fetch (async) variant has the simplest code. Examples: XMLHttpRequest (non-async) XMLHttpRequest (async) fetch (async)