Good morning,
I'm doing tests with IONIC, and I try to do a REST API in PHP. The value is sent from the app through the following call:
return this.http.post(this.url + '/', body, reqOpts);
The object I want to recover is the body, according to the browser console:
console.log(body):
// respuesta:
Object { email: "[email protected]", password: "test" }
I do not know how to recover the object, and I have tried:
header('Access-Control-Allow-Origin: *');
$header = $_SERVER['HTTP_ORIGIN']; // Esto devuelve correctamente Header: http://localhost:8100
$password = filter_var($_REQUEST['password'], FILTER_SANITIZE_STRING, FILTER_FLAG_ENCODE_LOW);
$input = json_decode(file_get_contents('php://input'),true);
Both $ password and $ input are empty, they do not even contain arrays. How can I recover these values?
Thanks in advance.