Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.       const axiosConfig = {
  2.         url: 'http://localhost/velvion-mailapi',
  3.         method: 'POST',
  4.         data: {
  5.           from: `${vm.form.name} <${vm.form.email}>`,
  6.           text: vm.form.message
  7.         },
  8.         withCredentials: true,
  9.         crossdomain: true,
  10.         auth: {
  11.           username: 'app',
  12.           password: 'website'
  13.         },
  14.         headers: {
  15.             'Accept': 'application/json',
  16.             'Content-Type': 'application/json',
  17.             'X-Requested-With': 'website'
  18.         }
  19.       }
  20.  
  21.       axios.request(axiosConfig)
  22.       .then(function (response) {
  23.         console.log(response);
  24.         vm.form.sending = 'success'
  25.       })
  26.       .catch(function (error) {
  27.         console.log(error);
  28.         vm.form.sending = false
  29.         vm.form.error = error.message
  30.       })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement