Static GitHub Issues

[2497] this.$axios request always return OPTIONS instead GET, POST, PUT, DELETE

prev: [Global css] Different css files for the same node module are ignored
next: oauth2

components/index.vue

<template>
  <div>
    <p>{{ $store.state.token }}</p>
    <v-btn class @click="reqs">click to request</v-btn>
  </div>
</template>

<script>
export default {
  methods: {
    async reqs (ctx) {
      let me = await this.$axios.get('/cek')
      console.log(me.data)
    }
  }
}
</script>

so, i click "Click to request" and get this response from server x I have tried with postman, and the result is normally, but, why if i use nuxt axios modules the request always changed to OPTIONS (instead GET, POST, PUT)... what should i do ?

NOTE:

  • I use @nuxtjs/axios modules
  • I use setToken in requestInterceptors placed nuxt.config.js

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c2168">#c2168</a>)</em></sub></div>