15 lines
479 B
JavaScript
15 lines
479 B
JavaScript
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;
|