【備忘錄】vue resource POST with multipart/form-data

1. options, emulateJSON: truevue

this.$http.post('/api', data, {
   emulateJSON: true
})

2. FormDatagit

var formData = new FormData();
formData.append('foo', 'bar');

this.$http.post('/api', formData)

reference: https://github.com/pagekit/vue-resource/issues/267github

相關文章
相關標籤/搜索