I made a little api in php:
<?php
header('Content-Type: application/json');
header('Access-Control-Allow-Origin: *');
include_once'conexion.php';
$cliente_usu = $_GET['cliente_usuario'];
$cliente_pass = $_GET['cliente_pass'];
if($_SERVER["REQUEST_METHOD"] == 'GET')
{
$consulta_buscar_usuario = 'SELECT * FROM api_usuario WHERE usuario_nombre = ? AND usuario_contrasena = ?';
$ejecutar_cbu = $pdo->prepare($consulta_buscar_usuario);
$ejecutar_cbu->execute(array($cliente_usu,$cliente_pass));
$data_respuesta = $ejecutar_cbu->fetch();
}
echo json_encode($data_respuesta);
?>
that receives a username and password and returns a json, the problem is that it repeats the information
it should only return what is inside the red box, I use a local apache server and a mysql database with which it connects correctly, to consume the api I use the following line: http://localhost/api/datos.php? client_user=admin&client_pass=admin