I'm testing angularjs' simple ajax request and it seems to be not working. The request is made, and I'm getting 200, but the data is not passing.
$http({
url: "myphp.php",
method: "GET",
dataType: "json",
data: {"foo":"bar"}
}).success(function(data, status, headers, config) {
console.log(data);
}).error(function(data, status, headers, config) {
$scope.status = status;
});
<?php
echo var_dump($_GET);
?>
Same result both with get and post. If I'm trying to access $_GET['foo'] for instance, I'm getting an undefined index exception.
What am I doing wrong?