I need change the charset to utf-8.
Vue.http.options.emulateJSON = true
// set charset
Vue.http.options.headers = {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
}
// or
Vue.http.options.beforeSend = function(request) {
request.headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';
};
but on request has data, the 'Content-Type' aways equal application/x-www-form-urlencoded;

Hi.
I've got same problem. I'm using Vuejs + vue-resource with Symfony 3.
Did you already solved this problem ?
Dusan.
Vue.http.options.emulateHTTP = true
Vue.http.options.headers = {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
}
Vue.http.interceptors.push((request, next) => {
let body = request.body
if (body) {
let array = []
for (var key in body) {
array.push(key + '=' + body[key])
}
request.body = array.join('&')
// ...
}
})
Most helpful comment