I use Vue mixings to have a global way to send requests to an API:
Vue.mixin({ methods: { api (method, path, data = null) { const init = { /* ...