Error on external API connection


My page is published and opening with no navigation issues. My issue is that I am trying to connect to an external API to get information from another application. I have a “Connect” button and when I click on it, I am redirected to a 404 page not found.

My code is

fetch(‘’, { method: ‘POST’, headers: { ‘Authorization’: 'Basic ’ + btoa(anaUser.value + ‘:’ + anaPwd.value) } }).then((response) => response.json()).then((json) => console.log(json))

My page is (](

I really appreciate any help you can provide.

You’re using a form, the browser’s default action is to post it to the same page. You need to use JavaScript:

document.querySelector('form').addEventListener('submit', event => {

then do the rest of the stuff.

This is not a Netlify issue.