你可以看到在Here網址(我把網址中因爲引擎收錄的網址很長)。
捲曲&部首:
$header=array();
$header[]="Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
$header[]="Accept-Encoding: gzip, deflate";
$header[]="Accept-Language: en-US,en;q=0.5";
$header[]="Connection: keep-alive";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7');
curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_exec($ch);
結果:
錯誤400 - 錯誤的請求 從RFC 2068超文本傳輸協議 - HTTP/1.1: 10.4.1 400錯誤請求
由於格式錯誤,服務器無法理解請求。直接進入網址時,沒有捲曲的客戶端不應該重複該請求不修改「
的瀏覽器:。
漂亮的一面展示
嘗試刪除所有標題,看看會發生什麼。然後將它們一次添加回去。 –