vue-resource
vue-resource copied to clipboard
I need to change 'Content-type' for request. How can I do it?
I need to set content-type to 'application/json-rpc' but I can't do it. I try this code:
let headers = {
headers: {
'Content-Type': 'application/json-rpc'
}
}
return Promise.resolve()
.then(function () {
return http.post(self.baseUrl, requestObj, headers).then()
})
but request is still have
Content-Type:application/json;charset=UTF-8
I can set right 'Content-Type' in global scope
Vue.http.headers.post['Content-Type'] = 'application/json-rpc'
But it's not good.
Is it possible to set content type in specific request?
Try this:
return http.post(self.baseUrl, requestObj, {options: headers}).then()
I tried this.$http.post(bbvaRateUrl, form, {headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}}).then( ... ) but no luck
I am having the same issue. @steffans, would you be able to answer this, or someone else I can ping?