Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const axiosConfig = {
- url: 'http://localhost/velvion-mailapi',
- method: 'POST',
- data: {
- from: `${vm.form.name} <${vm.form.email}>`,
- text: vm.form.message
- },
- withCredentials: true,
- crossdomain: true,
- auth: {
- username: 'app',
- password: 'website'
- },
- headers: {
- 'Accept': 'application/json',
- 'Content-Type': 'application/json',
- 'X-Requested-With': 'website'
- }
- }
- axios.request(axiosConfig)
- .then(function (response) {
- console.log(response);
- vm.form.sending = 'success'
- })
- .catch(function (error) {
- console.log(error);
- vm.form.sending = false
- vm.form.error = error.message
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement