Something like this should work.
fetch('http://localhost:8090/get/directory', {
headers: {
'Accept': 'application/json',
'Path': '/',
}
})
.then(response => response.json())
.then(json => console.log(json));
You can call this from in a useEffect()
in your React app, for example. Or componentDidMount
if it is a class component.