axios中post请求application/x-www-form-urlencoded

就这么简单

import qs from 'qs';
axios({
     
    method: 'POST',
    headers: {
      'content-type': 'application/x-www-form-urlencoded' },
    data: qs.stringify(params),   // 用 qs 将js对象转换为字符串 'name=edward&age=25'
    url: 'http://111.207.157.119:29000/emergency/api/auth/token'
}).then(res => {
     
	console.log(res)
});

你可能感兴趣的:(axios中post请求application/x-www-form-urlencoded)