Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
342 views
in Technique[技术] by (71.8m points)

PHP, curl, and raw headers

When using the PHP curl functions, is there anyway to see the exact raw headers that curl is sending to the server?

question from:https://stackoverflow.com/questions/1828935/php-curl-and-raw-headers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can use curl_getinfo:

Before the call

curl_setopt($ch, CURLINFO_HEADER_OUT, true);

After

$headers = curl_getinfo($ch, CURLINFO_HEADER_OUT);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...