How do I log the raw HTTP headers with a PHP script?

Posted by php on Stack Overflow See other posts from Stack Overflow or by php
Published on 2010-06-16T14:39:48Z Indexed on 2010/06/16 14:42 UTC
Read the original article Hit count: 169

Filed under:
|
|
|

I'm using a cURL script to send POST data through a proxy to a script and I want to see what raw HTTP headers the cURL script is sending. List of things I've tried:

echo curl_getinfo($ch, CURLINFO_HEADER_OUT) gives no output. file_get_contents('php://input') gets some HTTP headers but not all. print_r($_SERVER) also gets some HTTP headers but not all (I know this because there should be a X-Forwarded-For header and there isn't) Printing all superglobals ($_POST, $_GET, $_REQUEST, $_FILES etc) still doesn't show the raw HTTP headers. http_get_request_headers(), apache_request_headers(), $http_response_header, $HTTP_RAW_POST_DATA aren't outputting everything.

Help?

© Stack Overflow or respective owner

Related posts about php

Related posts about http