2010-07-08 105 views
0

我必须确保curl正在发送cookies,因此我应该查看request(not response!)http标头的全文。有什么办法可以做到吗?如何获取请求的全文(不是响应)头文件?

谢谢

+0

可能的重复[如何在发送请求到服务器时看到由curl创建的请求标头?](http://stackoverflow.com/questions/866946/how-can-i-see-the-request -laders-made-by-curl-when-sent-a-request-to-serv) – Dolph 2010-07-08 21:05:52

回答

0

很明显,你需要在某个时候拦截请求头。考虑到您想查看curl的标题,我会建议setting up a transparent proxy。对于一个相对简单的解决方案,我会建议一个工具,如WireShark

+0

使用[code] foreach(getallheaders()作为$ name => $ value)创建php页面更简单echo“$名称:$ value \ n“; [/ code]。 UPD:感谢您分享WireShark,嗅探所有http流量以找出curl用于请求的头文件是非常好的主意。 – Kirzilla 2010-07-08 21:03:22

+0

我没有看到'php'标签...我假设你从命令行运行curl。标记你的问题作为愚蠢(见答案的PHP):http://stackoverflow.com/questions/866946/how-can-i-see-the-request-headers-made-by-curl-when-sending-a -request到的业务模型/ 2138886#2138886 – Dolph 2010-07-08 21:05:46

相关问题