Trying to get a simple GET response in Vue.js by pressing a button (with axios), does not work

I have tried suggestions such as:

Print response from http GET request using axios in vue.js?

Vue.js + Axios not assigning response Get response data from axios in vue.js

simple typescript function with axios get call does not work

None have solved the issue.

This is the code that I have (port 2020, doesn't work with 8080 either):

    <p>{{ testResponse }}</p>
      <button v-on:click="sendRequest">Get Data</button>
    const axios = require("axios");
    export default {
      name: 'Auth',
      created: function () {
      data: function () {
        return {
      beforeMount() {},
      methods: {
        sendRequest() {
        async getEvents(url) {
              .then(response => {this.testResponse =})

Pressing the button does not do anything. The GET does get sent, servers process the GET, but no data is obtained from it... What am I doing wrong ?

Edit: removed the junk.

Read more here:

Content Attribution

This content was originally published by Damir Olejar at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: