//add headers
this.$http.post('/api', data, {
   headers: {
       'Content-Type': 'multipart/form-data'
   }
})

//or send request data as application/x-www-form-urlencoded content type.
this.$http.post('/api', data, {
   emulateJSON: true
})

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

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

 

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

相关文章:

  • 2022-12-23
  • 2021-05-19
  • 2021-07-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-02
猜你喜欢
  • 2022-01-10
  • 2021-07-15
  • 2022-12-23
  • 2022-12-23
  • 2021-10-31
  • 2021-11-23
相关资源
相似解决方案