【备忘录】vue resource POST with multipart/form-data

1. options, emulateJSON: true

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

2. FormData

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

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

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

posted @ 2017-06-29 11:25  xiaoroad  阅读(1208)  评论(0编辑  收藏  举报