title: Send surveyjs result to API
body: <p>I am trying to send surveyjs results to my API.</p>
  
  <p>In mounted(), I make a <code>GET</code> request with <code>vue-resource</code>, get questions from my dB and then set surveyjs. To send the results, I tried to use <code>this.$http.post</code>, in the surveyJS <code>onComplete</code> function, but I got <code>Cannot read property 'post' of undefined</code>. Also, I tried to put a watch on the <code>result</code> variable, but it did not work.</p>
  
  <pre><code>mounted() {
      this.$http
        .get("myAPI")
        .then(res =&gt; res.json())
        .then(questions =&gt; {
          this.questions = questions;
          this.survey = new SurveyVue.Model(this.questions.pesquisa);
          this.survey.locale = "pt";
  
          this.survey.onComplete.add(function(survey) {
            this.result = survey.data;
            this.$http
            .post(
              `myAPI`,
              this.result,
              { headers: { "Content-Type": "application/json" } }
            )
            .then(response =&gt; {
              console.log(response);
              UIkit.notification({
                message: "Success",
                pos: "top-center",
                status: "success"
              });
            })
            .catch(error =&gt; {
              console.log(error);
              UIkit.notification({
                message: "Erro",
                pos: "top-center",
                status: "danger"
              });
            });
          }); 
        })
        .catch(error =&gt; {
          console.log(error);
          UIkit.notification({
            message: "Error",
            pos: "top-center",
            status: "danger"
          });
        });
  }
  </code></pre>