所以,我想得到JSON数据的关键值(从POSTFIELD)在这里我的卷发后测试
<?php
$u = "asd";
$p = "asd";
$tokens = "asd";
$fields_string = '{ "cvalue":"' . $u . '", "ctype":"username", "password":"' . $p . '", "captchaToken":"' . $tokens . '", "captchaId":"", "captchaProvider":"PROVIDER_ARKOSE_LABS" }';
$ch2 = curl_init();
curl_setopt($ch2, CURLOPT_URL, 'https://www-robloxa.com/dd.php');
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch2, CURLOPT_POST, 1);
curl_setopt($ch2, CURLOPT_POSTFIELDS, $fields_string);
$headers = array();
$headers[] = 'Content-Type: application/json';
$headers[] = 'Accept: application/json';
$headers[] = 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36';
$headers[] = 'Referer: https://www.roblox.com/login';
$headers[] = 'Origin: https://www.roblox.com';
curl_setopt($ch2, CURLOPT_HTTPHEADER, $headers);
$output = curl_exec($ch2);
echo $output;
?>
这里是我的phpapi,当我试图获取json的值时
<?php
header('Access-Control-Allow-Origin: *');
echo $_POST['cvalue']
?>
1条答案
按热度按时间kzipqqlq1#
尝试使用“文件获取内容”: