首頁  >  文章  >  後端開發  >  php-PHP怎么获取获取angularjs http.post

php-PHP怎么获取获取angularjs http.post

WBOY
WBOY原創
2016-06-02 11:28:23867瀏覽

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'); 没显示任何数据
图片说明
这是什么原因,没获取到数据吗?

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn