Ineed to make a request exactly like the browser does it with CURL and PHP, when a copy as Curl (cmd) i see this headers:
curl "https://www.w3schools.com/js/ajax_info.txt"
-H "Sec-Fetch-Mode: cors"
-H "referer: https://www.w3schools.com/js/tryit.asp?filename=tryjs_ajax_first"
-H "Origin: https://www.w3schools.com"
-H "user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36"
-H "dnt: 1"
--compressed
I have some code but i need more options, for example the part "--compressed" i do not have idea how to include it at request
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL, 'https://www.w3schools.com/js/ajax_info.txt');
$data = curl_exec($ch);
curl_close($ch);
return $data;
?>
i can nnot see a result beacause are headers