I want to read a JSON in PHP received from a function $http.post()
of AngularJS, I already tried to use json_decode()
and set the header (both PHP and Angular) but it did not work. PHP claims to be an undefined index, I tried to use var_dump and it returns NULL.
Angular
$http.post(path, $scope.meuJson, { headers: { 'Content-Type': 'application/json' } }).success(function(response) { ... })
PHP
header('Content-type: application/json'); $json = json_decode($_POST['meuJson']);
var_dump ($ _ POST)
array(0) { }
NOTE: I can see the data being sent as payload of my request by the Network