要将请求验证令牌设置为标头,更紧密地模仿AJAX请求,并将content-type设置为JSON,请使用CURLOPT_HEADER。
curl_setopt($ch, CURLOPT_HTTPHEADER, array("X-Requested-With: XMLHttpRequest", "Content-Type: application/json; charset=utf-8", "__RequestVerificationToken: $token"));我还注意到,您在代码的第7行上多余地将CURLOPT_POST设置为false,并且您发送的帖子数据不是JSON格式。你应该有:
$postVariables = '{"historyPageIndex":1,"displayPeriod":0,"productsType":"All"}';


