1. 程式人生 > >axios設置application/x-www-form-urlencoded

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

ont pre ons encode .com mark ios earch har

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

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