This question already has an answer here:
Hi for this great community. I'm new ones to create api's in php. The problem is I'm not able to get the response when i send the raw request from the postman.Here is my code for raw_request_api.php
<?php
if(isset($_REQUEST['json'])) {
$jsonobj = $_REQUEST['json'];
$json = json_decode($jsonobj);
echo json_encode($json);
}else
echo "Unable to get the request data";
?>
I'm getting the response when I use Form data as well as x-www-form-urlencoded.
But I'm not able to get the response from the raw data. Please help me where i'm making the mistake? Also I tried every format for raw data...like text/html, application/json, application/xml, text/xml...nothing works
</div>