Fetch returns empty array

So I am sending POST request to my API but it’s returning just an empty array. It should return array of objecst.

const getRules = function () {
  console.log(selectedRule.value);
  fetch("http://127.0.0.1:5112/v1/showFiles", {
    method: "POST",
    body: JSON.stringify({ rule_dir: selectedRule.value }),
  })
    .then((response) => response.json())
    .then((response) => console.log(JSON.stringify(response)));
};

Any idea how to resolve it ?