[Vuejs]-Posting to Zapier Hook with Axios in Vue causes CORS error

0๐Ÿ‘

โœ…

I used a third party form service (FlexyForm) instead to handle my form submissions.

This way I avoided having to work around anything and my forms are cleaner.

2๐Ÿ‘

You can use the transformRequest property of axios to remove the Content-Type header. The snippet below removes all the headers from an axios post request and will allow you to send a post request to Zapier.

axios.create({ transformRequest: [(data, _headers) => JSON.stringify(data)] })
     .post()

Leave a comment