Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Vue.js Axios
import Vue from 'vue'
import Axios from 'axios'
import VueAxios from 'vue-axios'
Vue.use(VueAxios, Axios)
//以下コードをVue componentの中でよしなにつかってください
var token = 'csrf_token here'
Axios.post('/post_url',{
article: { body: 'text text', title: 'title title' },
csrf_token: token
})
.then(response => {
//200 status header etc...
// console.log(response)
})
.catch(error => {
// console.log(error.response)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment