I am making a post request to a php file that needs some data that is sent by the request. My question is how to retrieve this information being sent in the request
My code for the request looks like this:
//pego a descricao no compa input
var dados = {"descricao": $('#descricao').val()};
$scope.getData = function() {
$http.post('data.php', dados).success(function(data) {
...
console.log(data);
}).error(function(data) {
...
console.log(data);
});
How would you get this information in the 'data.php' file?
var_dump($_POST);
returns an empty array: array(0) { }