Re: Reading all headers sent

From: Date: Tue, 29 Mar 2005 15:56:19 +0000
Subject: Re: Reading all headers sent
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-211783@lists.php.net to get a copy of this message
Solved, Just in case someone finds it usefull. I could get the raw post with :
$send     = $GLOBALS['HTTP_RAW_POST_DATA'];
And then the headers I need in the $_SERVER globals. $header[] = "MessageType:$_SERVER[HTTP_MESSAGETYPE]"; // CALL
$header[] = "Content-Type:$_SERVER[CONTENT_TYPE]";     // text/xml
MARTIN www.movil.be Richard Lynch wrote:
Search php.net for "RAW HTTP" Maybe. On Fri, March 18, 2005 3:28 am, martin said:
Thanks for the answer, what I'm trying to achieve is a php proxy that receives any GET/POST request with correspoding headers and brings back the results to the caller. Let's say I do a google search request with curl: // I would like all this to be sent by another page --- (header + xml) $data ="soapreq.xml"; $handle = fopen ($data, "r"); $send = fread ($handle, filesize($data) ); fclose($handle); $header[] ="MessageType:CALL"; $header[] ="Content-Type:text/xml"; // -------------------------------------- I don't know if what I want can be achieved this way, but maybe this explains better the idea.
$ch      = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://api.google.com/search/beta2");
curl_setopt($ch, CURLOPT_POST,        1);
curl_setopt($ch, CURLOPT_POSTFIELDS,    $send);
curl_setopt ($ch, CURLOPT_HTTPHEADER, $header); $data = curl_exec($ch); Best regards, MARTIN Jesper Goos wrote:
The $SERVER variable is an array, so try this: <? echo "<pre>"; print_r($_SERVER); echo "</pre>"; ?> regards Jesper martin wrote:
Hi, I wanted to know if there is some way to expose the full headers sent to a php page. I found in google that for windows there is $_SERVER['ALL_HTTP'] to read all the headers sent but I'm using php on linux/apache. There is any way to get in a variable the full headers sent to a page ? Best regards, MARTIN
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.general (#211783) next »