当前位置:Gxlcms > PHP教程 > php-PHP怎么获取获取angularjshttp.post

php-PHP怎么获取获取angularjshttp.post

时间:2021-07-01 10:21:17 帮助过:21人阅读

http.postphppostangularjs

前端:$http({
method: 'POST',
url: "http://127.0.0.1:8080/school/studentadd.php",
data : newnames,
headers : {'Content-Type': 'application/x-www-form-urlencoded' }
}).success(function(){
console.log('success');
}).error(function(){
alert("error");
});
PHP接收:echo file_get_contents('php://input'); 没显示任何数据
图片说明
这是什么原因,没获取到数据吗?

人气教程排行