Home  >  Article  >  Backend Development  >  curl 如何看请求头

curl 如何看请求头

WBOY
WBOYOriginal
2016-06-13 12:55:30774browse

curl 怎么看请求头
这个可以看响应头


	$url = "http://www.baidu.com";
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_HEADER,1);
curl_setopt($ch,CURLOPT_NOBODY,1);
curl_exec($ch);
curl_close($ch);
?>


请求头 怎么看???

另外问一下  我3个月前注册了phpchina的账号
怎么3个月过去了 还是等待验证  不能进论坛(不登陆都可以进论坛)  不能发帖  


------解决方案--------------------
可以查看 curl_getinfo  返回的数据
------解决方案--------------------
curl_setopt($ch,CURLOPT_HEADER,1);

结果中含有返回的头

请求的头用 curl 是看不到的
------解决方案--------------------
抓包软件
firefox用firebug/httpfox
网卡用SmartSniff
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn