跨域post实例,用到了qs组件来避开ajax信使请求,并兼容Android。
import axios from ‘axios‘;
import qs from ‘qs‘;
axios.post(‘http://www.xyz.com/request‘, qs.stringify(params))
.then(response => {
console.log(response);
})
.catch(err => {
console.log(err);
});
2022-09-27 07:39:12
跨域post实例,用到了qs组件来避开ajax信使请求,并兼容Android。
import axios from ‘axios‘;
import qs from ‘qs‘;
axios.post(‘http://www.xyz.com/request‘, qs.stringify(params))
.then(response => {
console.log(response);
})
.catch(err => {
console.log(err);
});