Solution 1 :

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.

Problem :

I have a GET curl request

curl -X GET "http://localhost:8000/get/folder" -H  "accept: application/json" -H  "path: /"

By