axios 配置 content-type

1、
axios({ method:
'get', url:'http://bit.ly/2mTM3nY1233455,
headers: {
  'content-type': 'text/xml'
  },
data: {}
}) .then(function(response) { });



2、
axios({
  method:'get',
  url:'http://bit.ly/2mTM3nY1233455,
  
  transformRequest: [function (data, headers) {
  headers.common['Content-Type'] = 'text/xml';
    return headers
  }],

}) .then(function(response) { });
 

 

posted @ 2022-09-08 10:44  王希有  阅读(491)  评论(0编辑  收藏  举报