Level 75
Is it your site? If 3rd party they will have instructions.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello Website have json data which is accessible only for login user.
Using Curl I have successfully login
$cookie="cookie.txt";
$data = [ "password" => 'test', "username" => '1',];
$data_json = json_encode($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.site.com/Login');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$data_json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
but how can I read json data from protected url
Please or to participate in this conversation.