avatar

Catalog
axios post data by form type

axios post data by form type,axios application/x-www-form-urlencoded

Javascript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
request({
// url: '',
transformRequest: [function(data) {
let ret = ''
for (let it in data) {
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
}
return ret
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
method: 'post',
params: query
})
Author: Qin
Link: https://qinhaolei.com/posts/3174/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Reward
  • WechatPay
    WechatPay
  • AliPay
    AliPay
  • Bitcoin
    Bitcoin

Comment