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

posted @ 2018-02-08 16:24  wmui  阅读(10361)  评论(0)    收藏  举报