I AM trying to get a JSON file from a another site and for this I am trying to make a post request but I am not able to get a JSON data. I am sharing my PHP code and CURL data please tell me where is problem and why it is not working
PHP
<?php
$a="liveclasses";
$b="playvod";
$c ="mod=liveclasses&ack=playvod&stream=https%3A%2F%2Fslhdovces.toprankers.com%2Fbharthiconcept%2F1128732%2F1128732-pr-BIOLOGYbyLavkushpandeysirClass21-bharthiconcept-1573820502927%2F1128732-pr-BIOLOGYbyLavkushpandeysirClass21-bharthiconcept-1573820502927.m3u8";
$url = 'https://live.bharticoncept.com/route?route=common%2Fajax';
$data = array('mod' => $a,'ack' =>$b, 'stream' => $c);
$options = array(
'http' => array(
'Host' => "live.bharticoncept.com",
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'cookie'=>"tr_live_bharticoncept_com=so1ofdpkcleeshaq5dsevteia0",
'method' => 'POST',
'content' => http_build_query($data)
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) {
}
echo("$result");
?>
And curl
curl -X POST -H "Host:live.bharticoncept.com" -H "content-type:application/x-www-form-urlencoded; charset=UTF-8" -H "cookie:tr_live_bharticoncept_com=so1ofdpkcleeshaq5dsevteia0" -H "content-length:255" -d 'mod=liveclasses&ack=playvod&stream=https%3A%2F%2Fslhdovces.toprankers.com%2Fbharthiconcept%2F1128732%2F1128732-pr-BIOLOGYbyLavkushpandeysirClass21-bharthiconcept-1573820502927%2F1128732-pr-BIOLOGYbyLavkushpandeysirClass21-bharthiconcept-1573820502927.m3u8' "https://live.bharticoncept.com/route?route=common%2Fajax"