Hello,
I am trying to use an asset in the react app located in the ui.frontend of my project and to conduct some test to see if the api would work I called:
const myHeaders = new Headers();
myHeaders.append("Authorization", `Basic YWRtaW46YWRtaW4=`);
myHeaders.append("Content-Type", "application/json");
fetch(
{
method: "GET",
headers: myHeaders,
redirect: "follow",
}
)
.then((response) => console.log(response))
.catch((error) => console.log(error));
I am able to call this endpoint in the browser, in curl and in Postman but cannot get any response in the react application. I have exhausted a search through the documentation and cannot find any information. Can some one confirm that I can call this API in a react application in AEM and why do I always get a response 204- No Content?