#Page being reloaded after a POST request being sent from renderer.js and don't know why

1 messages · Page 1 of 1 (latest)

river needle
#

I have a renderer.js file that amongst other things it captures a screenshot from the webcam and sends to an API. The problem I'm having is that the minute the request is sent, the page gets reloaded, I don't even get to see the response and I don't know why. This is the code:

    method: "POST", body: formData, headers: {
        'X-RapidAPI-Key': 'your-rapidapi-key'
    }
});
console.log(response.json());```

The page is reloaded even before I get to `console.log`. Any ideas why? This is *not* an issue where I should use `event.preventDefault()` as I already tried and this is not triggered by a form
desert hatch
#

fetch do not trigger page reload

river needle
#

Yeah I know, it shouldn't but as soon as I remove the fetch call the page does not reload

desert hatch
#

and what your api do?

#

save something on harddrive?