I'm developing a system that will use a webservice in PHP and the structure that will be called to execute this webservice is as follows:
<?php
header("Content-Type: application/json; charset=utf-8") ;
require_once( "Core.class.php" ) ;
require_once( "Nomes.class.php" ) ;
$acao = "";
$core = new Core( ) ;
$nome = new Nomes( $core ) ;
if(isset($_POST['acao'])){
$acao = $_POST['acao'];
switch ($acao) {
case "R":
$lista = $nome->search( ) ;
echo json_encode( $lista ) ;
break;
}
}
?>
I'm testing on Postman by putting "action" on the parameter and "R" for value, but nothing returns. Before I put the if(isset($_POST['acao'])){$acao = $_POST['acao'];
that I will use to create a CRUD, it was working normally, only after that it stopped working. Does anyone know what it could be?