Answer the question
In order to leave comments, you need to log in
How to send default data via axios?
Create with default url
Vue.use({
install (Vue) {
Vue.prototype.$api = axios.create({
baseURL: 'http://127.0.0.1'
})
}
})
this.$api.post('', {
"jsonrpc": "2.0",
"id": 1,
"method": "login"
})
Answer the question
In order to leave comments, you need to log in
const defaultData = {
"jsonrpc":2.0,
"id":1
}
// .......
this.$api.post('', Object.assign(defaultValues, {
"method": "login"
}));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question