Open rainit2006 opened 3 years ago
////
php:如何获得请求时的header信息: https://cl.pocari.org/2009-02-16-1.html
// 保存するファイル
$fp = fopen('/tmp/curl.log', 'a');
// 詳細な情報を出力する
curl_setopt($ch, CURLOPT_VERBOSE, true);
// STDERR の代わりにエラーを出力するファイルポインタ
curl_setopt($ch, CURLOPT_STDERR, $fp);
Example
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.google.com/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// 保存するファイル
$fp = fopen('/tmp/curl.log', 'a');
// 詳細な情報を出力する
curl_setopt($ch, CURLOPT_VERBOSE, true);
// STDERR の代わりにエラーを出力するファイルポインタ
curl_setopt($ch, CURLOPT_STDERR, $fp);
$ret = curl_exec($ch);
fclose($fp);
curl_close($ch);
。。。。