またはのような関数によって送信された正確なヘッダーを取得する方法はありますfile_get_contents()かget_headers()?
お気に入り
get_headers('http://google.it');
echo php_get_request_headers(); //> ?
この問題が一度発生したので、私が使用しているのはfiddler http://www.fiddler2.com/fiddler2/などのプロキシです。
$default_opts = array(
'http'=>array(
'method'=>"HEAD",
'proxy'=>"tcp://localhost:8888"
)
);
$default = stream_context_set_default($default_opts);
$headers = get_headers('http://google.com');
var_dump($headers);
これは、などstream_context_set_default で機能するため、このスクリプトによって送信されたすべての要求をキャプチャします。file_get_contentsfopen