axios发送post form请求

axios发送post form请求

只需修改url和data即可

axios({
  url: ‘/user‘,
  method: ‘post‘,
  data: {
    firstName: ‘Fred‘,
    lastName: ‘Flintstone‘
  },
  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‘
  }
})

我的github
我的博客
我的笔记

axios发送post form请求

上一篇:用网页计数器来说明application和session


下一篇:[GYCTF2020]FlaskApp