php - Vue Resource Post Request Content-Type
Vue-Resource Post Request:
this.$http.post(form.action, new FormData(form)).then(function (response) {
FetchResponse.fetch(this, response.data)
})
Request are Send as Content-Type:"application/json;charset=utf-8" But No data can be displayed by PHP Post.
Set Up Header Vue-Resource:
request.headers.set('Content-Type', '');
But Request Content-Type:", multipart/form-data; boundary=----WebKitFormBoundaryTsrUACAFB1wuhFOR"
there is a comma at the beginning of the query.
Jquery Post Request:
$.ajax({
url : form.action,
type : 'POST',
data : new FormData(form),
success : function (reqData) {
FetchResponse.fetch(ss, reqData)
},
});
The same query works seamlessly with jQuery. jQuery Content-Type: "multipart/form-data; boundary=----WebKitFormBoundaryTsrUACAFB1wuhFOR"
Answer
Solution:
Please try instead to post a simple JSON object and enable the 'emulateJSON' vue-resource option: