错误写法:
instance.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
instance.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
正确写法:
instance.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
instance.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded';
更多推荐
vue项目中header中Content-Type自定义配置写法
发布评论