2
I’m testing a way to get data from a database with a simple API, I don’t know if it’s right, if you can give me a hand
I wanted it to work via POST, but the tests on POSTMAN only returns if I put REQUEST
header('Content-type: application/json');
$chave_de_acesso = "teste";
if($_POST['chave_de_acesso'] == $chave_de_acesso){
$array = array(
"acesso" => 'ok'
);
} else {
$array = array(
"acesso" => 'erro'
);
}
echo json_encode($array);
In this case, only returns by
REQUESTif you are using$_GETright? Or by$_POSTalso gives nothing?– CypherPotato
@Cypherpotato, By the POST there is nothing, only when I put REQUEST, but I continue with the POST Method
– Marcos Paulo