Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/256.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 带有post参数的ajax调用-无法在服务器端接收该参数_Php_Angularjs - Fatal编程技术网

Php 带有post参数的ajax调用-无法在服务器端接收该参数

Php 带有post参数的ajax调用-无法在服务器端接收该参数,php,angularjs,Php,Angularjs,我在下面添加了对ajax调用的调用 $http({ url: "http://localhost/angular-js-apis/listing.php", method: "POST", data: {type: "list"}, headers: {'Content-Type': 'application/json;charset=utf-8'} }).then(function mySuccess(response)

我在下面添加了对ajax调用的调用

$http({
        url: "http://localhost/angular-js-apis/listing.php",
        method: "POST",
        data: {type: "list"},
        headers: {'Content-Type': 'application/json;charset=utf-8'}
    }).then(function mySuccess(response) {
        $scope.listing = response.data;
    }, function myError(response) {
        $scope.myWelcome = response.statusText;
    });
和服务器站点上的以下文件代码


但在我的服务器中,它只打印
$\u POST
的空值


有人能告诉我这里有什么问题吗?

试试下面的片段

棱角分明

$data = json_decode(file_get_contents('php://input'), true);
print_r($data);
服务器

$data = json_decode(file_get_contents('php://input'), true);
print_r($data);
$data = json_decode(file_get_contents('php://input'), true);
print_r($data);