axios 請求格式

默認是application/json   這裏提交的參數變成了json格式ios

 

原先的應該是這樣子的git

Form Data 裏面的不同github

const params = new URLSearchParams()
    params.append('uid', 1)
    params.append('username', '魯大師')
    this.$axios.post(url, params, { headers: { 'Content-type': 'application/x-www-form-urlencoded' } }).then(res => {

    })

 

 

解決方法:https://github.com/axios/axios#browserjson

相關文章
相關標籤/搜索