new Vue({
el: '.box',
data: {},
methods: {
get: function () {
axios({
method: 'post',
url: 'post.php',
data: {
a:'1'
}
}).then(function (response) {
alert(response.data);
})
.catch(function (error) {
alert(error);
});
}
}
});
_
post.php 文件
$a=$_POST['a'];
$b=$_POST['b'];
echo $a;
大家帮我看看是什么原因,是post请求还需要转换吗
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
从浏览器看网络请求啊,貌似要指定content-type
碰到同样的问题,你尝试吧参数跟到接口地址后面试试看!
https://github.com/mzabriskie...
你把data换成JSON字符串试试