Angular request does not send post

0

Good evening !! next ... I'm making asynchronous requests with angularjs and it works if I use get and params, but if I change to "post" and "date" it stops sending ... I'll post here the controller and the page that receives the data:

app.controller('detalhe_carro', ProcessaAlteracao);

ProcessaAlteracao.$inject = ['$http', '$scope'];

function ProcessaAlteracao($http, $scope) {
    $scope.titulo = 'detalhes do carro'
    $scope.tituloCarro = "";
    $scope.descricao = "";
    $scope.ano_carro = "";
    $scope.marca = "";
    $scope.mensagem = "";
    $scope.update = "";
    $scope.requisicao = function () {
          $http( {method: "POST",  url: $scope.update, data: { nome: $scope.tituloCarro }})
                .then(function (response)
                {
                    $scope.retorno = response.data
                    console.log(response);
                }
                , function (response)
                {
                    console.log(response);
                });
    }
}

Now, the page that receives the data:

header('Content-Type: application/json charset=utf-8');
$x = array("info_recebida"=>$_REQUEST);
echo json_encode($x);

Anyway, what could have gone wrong with this code ??? I do not know how to solve this, with post, it will not at all ...

    
asked by anonymous 16.08.2017 / 00:18

0 answers