When using file_get_contents()
to request an external URL, how can I find out what headers I've sent, or alternatively what headers I am about to send? I'm basically looking for a request counterpart for $http_response_header
or anything else I can use to extract the same data.
I know I get to set headers myself with stream_context_create(array ('http' => array ('header' => $header)))
, but I want to see what headers are actually being sent in the end, including default ones.