I am attempting to send a GET request to an API, but I am encountering an error: Failed to fetch. What could be causing this issue?
const getData = () => {
fetch("https://test-docs.stores.kg/api/categories", {
method: "GET",
headers: {
secretKey: "test_key",
accept: "application/json "
}
})
.then((res) => res.json())
.then((res) => console.log(res));
};
getData();