axios设置application/x-www-form-urlencoded

this.$axios({
       method: 'post',
       url: 'http://www.17huo.com/tusou/deeplorSearch.html',
       headers: {
         'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
       },
       data: { imgFile: url },
       params: { imgFile: url }
     }).then(data => {
       console.log(data)
     })

data和params都必须传递,最好还是让后端设置支持application/json

原文地址:https://www.cnblogs.com/yesyes/p/8432101.html