title: Vue Js Form post issues to server
body: <p>I am building a website and I cannot find a way to send my SignUp form data to my server using post. I tried with axios but it didn't work.
  This is basically how my signup page looks like</p>
  
  <pre><code>&lt;template&gt;
    &lt;div id = "app"&gt;
      &lt;!-- &lt;router-view /&gt; --&gt;
      &lt;h1&gt;{{ $t('signup') }}&lt;/h1&gt;
      &lt;p&gt;{{ $t('signupMsg') }}&lt;/p&gt;
      &lt;b-form @submit="onSubmit" @reset="onReset" method="post" &gt;
        &lt;b-form-group
          id="input-group-1"
          label-for="input-1"
        &gt;
        &lt;p1&gt; Name: &lt;/p1&gt;
          &lt;b-form-input
            id="input-1"
            v-model="form.name"
            required
            placeholder="Enter Name and Vorname"
          &gt;&lt;/b-form-input&gt;
        &lt;/b-form-group&gt;
  
        &lt;b-form-group id="input-group-2" label-for="input-2" &gt;
          &lt;p1&gt;{{ $t('tech') }}&lt;/p1&gt;
          &lt;b-form-input
            id="input-2"
            v-model="form.technicianID"
            required
            placeholder="Enter assigned Technician ID"
          &gt;&lt;/b-form-input&gt;
        &lt;/b-form-group&gt;
        &lt;b-form-group id="input-group-3" label-for="input-3"&gt;
          &lt;p1&gt; Email ID: &lt;/p1&gt;
          &lt;b-form-input
            id="input-3"
            v-model="form.email"
            required
            placeholder="Enter assigned Email ID"
          &gt;&lt;/b-form-input&gt;
        &lt;/b-form-group&gt;
        &lt;b-form-group id="input-group-4" label-for="input-4"&gt;
          &lt;p1&gt; {{ $t('branch') }} &lt;/p1&gt;
          &lt;b-form-input
            id="input-4"
            v-model="form.branch"
            required
            placeholder="Enter your branch"
          &gt;&lt;/b-form-input&gt;
        &lt;/b-form-group&gt;
  
        &lt;!-- &lt;b-button type="submit" &gt; &lt;router-link to="/requestsuccess"&gt;{{ $t('signup') }}&lt;/router-link&gt; &lt;/b-button&gt; --&gt;
        &lt;b-button type="submit" &gt;{{ $t('signup') }} &lt;/b-button&gt;
        &lt;b-button type="reset" variant="danger"&gt;{{ $t('reset') }}&lt;/b-button&gt;
        &lt;router-link to="/" class="btn btn-link"&gt;{{ $t('back') }}&lt;/router-link&gt;
      &lt;/b-form&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
  import axios from 'vue-axios'
  export default {
    name: 'signup',
  
    data() {
        return {
          form: {
            name: '',
            technicianID: '',
            email:'',
            branch: ''
          }
      }
      },
      methods: {
        onSubmit(evt) {
          evt.preventDefault()
          axios({
            method: 'post',
            url: '/insert',
            data: this.form
            })
          .then(function (response) {
          //handle success
            console.log(response);
            })
          .catch(function (response) {
          //handle error
          console.log(response);
      });
  
        },
        onReset(evt) {
          evt.preventDefault()
          // Reset our form values
          this.form.name = ''
          this.form.technicianID = ''
          this.form.email = ''
          this.form.branch = ''
          // Trick to reset/clear native browser form validation state
          this.show = false
          this.$nextTick(() =&gt; {
            this.show = true
          })
        }
      }
  }
  
  &lt;/script&gt;
  
  &lt;!-- Add "scoped" attribute to limit CSS to this component only --&gt;
  &lt;style&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>This is how my index.js looks like for post</p>
  
  <pre><code>router.post('/insert', function(req, res, next) {
    var item = {
      name: req.body.name,
      technicianID: req.body.technicianID,
      email: req.body.email,
      branch: req.body.branch
    };
  
    mongo.connect(url, function(err, db) {
      assert.equal(null, err);
      db.collection('users').insertOne(item, function(err, result) {
        assert.equal(null, err);
        console.log('Item inserted');
        db.close();
      });
    });
  
    res.redirect('../components/requestsuccess');
  });
  </code></pre>
  
  <p>I am fairly new to this but I can't find a way to send my data to the server.</p>