I'm trying to post to a Pardot form handler endpoint using Nuxt/Axios. It's getting blocked on the prefetch check. Any thoughts on how to get around this?
const url = 'https://[pardot-endpoint]';
const requestBody = {
'Form Data': 'example',
}
const config = {
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Access-Control-Allow-Origin': '*',
}
}
this.$axios.post(url, requestBody, config).then(response => {console.log(response)})
This is the error I'm receiving:
Access to XMLHttpRequest at 'https://[endpoint]' from origin 'http://my.domain.local' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.