Home  >  Article  >  Backend Development  >  curl 怎么看请求头

curl 怎么看请求头

WBOY
WBOYOriginal
2016-06-23 13:56:221783browse

这个可以看响应头



请求头 怎么看???

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


回复讨论(解决方案)

可以查看 curl_getinfo  返回的数据

curl_getinfo
我在本地测试了一下
curl本地的一个文件
这个是看不到请求头的............

curl_setopt($ch,CURLOPT_HEADER,1);

结果中含有返回的头

请求的头用 curl 是看不到的

curl_setopt($ch,CURLOPT_HEADER,1);

结果中含有返回的头

请求的头用 curl 是看不到的


有没有什么办法能够看到请求头了????
比如什么工具 之类的

抓包软件
firefox用firebug/httpfox
网卡用SmartSniff

抓包软件
firefox用firebug/httpfox
网卡用SmartSniff


多谢
我问了下同事
他们教了我一下wrieshack  已经能抓到请求头了

PHP 5.1.3版以上支持用curl_getinfo函数来获取请求头
具体需要先设置 curl_setopt($s, CURLINFO_HEADER_OUT, true);
然后在请求发生后用 curl_getinfo( $ch, CURLINFO_HEADER_OUT)

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