I know this question has been asked severally and for two days I have been trying to follow the suggested fixes and answers from other questions but nothing is working. I am trying to test my php page for receiving json Data but the page seems not to be receiving anything. I am using postman to send the json and I am using PHP 7.3.27 Here is my code
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$content = file_get_contents('php://input');
echo "$content";
$decoded = json_decode($content,true);
var_dump($decoded);
$data = array();
if ($decoded['name']=='James') {
$data = array("Name"=>"James Blunt","username"=>"jamesBlunt","shoeSize"=>10);
}
print_r($data);
?>
The above code return NULL and an empty array. The following is my photo for postman.
So I am confused about this, am I doing something wrong? Do I need to add or edit anything in my php.ini file?
allow_url_fopen=On
allow_url_include=Off
I already have these two in my php.ini