我在PHP中遇到问题,请求:
我该怎么做?
答案 0 :(得分:1)
你可以从linux shell
尝试这个CURLcurl 'https://whoer.net/checkwhois' -H 'origin: https://whoer.net' -H 'x-requested-with: XMLHttpRequest' -H 'content-type: application/x-www-form-urlencoded; charset=UTF-8' -H 'referer: https://whoer.net/checkwhois' -H 'authority: whoer.net' --data 'partial=1&host=8.8.8.8' --compressed
在php中,以下代码应该有效:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://whoer.net/checkwhois');
curl_setopt($ch, CURLOPT_POST, 2);
curl_setopt($ch,CURLOPT_POSTFIELDS, 'partial=1&host=8.8.8.8');
$result = curl_exec($ch);
//close connection
curl_close($ch);
echo $result;