作者:芹牵一线 | 来源:互联网 | 2018-04-24 01:49
前端:$http({method:'POST',url:"127.0.0.1:8080schoolstudentadd.php",data:newnames,headers:{'Content-Type':'applicationx-www-form-urlencoded'}}).success(function(){console.log('success');
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'); 没显示任何数据
这是什么原因,没获取到数据吗?