Home  >  Article  >  Backend Development  >  php-PHP怎么获取获取angularjs http.post

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

WBOY
WBOYOriginal
2016-06-02 11:28:23866browse

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn