HTTP monitoring for PHP file_get_contents
Is there any tools like httpwatch/fiddler available to monitor the heade开发者_如何转开发rs send by PHP API like file_get_contents
Functions like file_get_contents
only send minimal headers (HTTP method and host
) as it's up to the developer to add any additional headers. You can see this for yourself by making a request to a script on your own server.
You can get them yourself: just query by file_get_contents()
your own script with (supposing you're using apache):
print_r(apache_request_headers());
And there you'll get all the headers being sent by file_get_contents
.
This might be a bit too much for your needs, but you can sniff any network packets with Wireshark
精彩评论