Error on external API connection

Hi,

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(‘https://auth.anaplan.com/token/authenticate’, { method: ‘POST’, headers: { ‘Authorization’: 'Basic ’ + btoa(anaUser.value + ‘:’ + anaPwd.value) } }).then((response) => response.json()).then((json) => console.log(json))

My page is (bejewelled-dolphin-3105ca.netlify.app)](https://bejewelled-dolphin-3105ca.netlify.app/)

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 => {
  event.preventDefault()
}

then do the rest of the stuff.

This is not a Netlify issue.