import FetchService from './FetchService.js'; const fetchService = new FetchService(); function buildHeaders(authorization = null) { const headers = { "Content-Type": "application/json", "Authorization": (authorization) ? authorization : "Bearer TOKEN_MISSING" }; return headers; } const response = await fetchService.performGetHttpRequest(window.location.href + 'text', buildHeaders()); document.getElementById("text").innerHTML = response.text;