using axios in a vue.js project, I'm having issues call the mailchimp API to sign up an email for a newsletter.
axios.post('//myappname.us9.list-manage.com/subscribe/post-json', {
u: 'abcde',
id: '12345',
EMAIL: this.email
}).then(response => {
console.log(response)
}).catch(response => {
console.log(response)
})
Results an error in the OPTIONS preflight:
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
How can I bypass these CORS issues? I tried with JSONP, that semi-works. My request come through, but I can't handle the response very well, as I don't really get a response, but just an error, as the response isn't a JSONP response, but a ordinary JSON response.
I used the vue-jsonp package for the jsonp test.
Any pinpointers? Would be much appreciated. Thanks.