Hi,
I'm trying to access data i $HTTP_RAW_POST_DATA received from a POST.
The data is not in key/value pairs, but rather a XML file.
The mime type in the POST is set to a undefined type.
PHP sets the $HTTP_RAW_POST_DATA variable, but it has no content ?
Why doesn't PHP set the content of $HTTP_RAW_POST_DATA ??
I run Apache 1.3.14 and PHP4.0.5.
Here is the PHP script:
<?
header("Content-type: text/plain");
if(isset($HTTP_RAW_POST_DATA))
{
if ( strlen($HTTP_RAW_POST_DATA) > 0 )
{
print "HTTP_RAW_POST_DATA is set, and it is:<br>";
print $HTTP_RAW_POST_DATA;
}
if ( strlen($HTTP_RAW_POST_DATA) == 0 )
{
print "HTTP_RAW_POST_DATA is set, but it has zero length";
}
}
?>
and here are the HTTP POST:
POST /bb/rolf/index.php HTTP/1.1
User-Agent: RolfBrowser (telnet klient)
Accept: /
Host: www1.moldenett.no
Content-Type: application/completecrap
Connection:close
<?xml version="1.0" encoding="UTF-8"?>
<x/>
Sent trough netcat (nc), produces this output:
[rolf@ns rolf]$ cat nettcatt | nc localhost 80
HTTP/1.1 200 OK
Date: Mon, 25 Jun 2001 08:52:19 GMT
Server: Apache/1.3.14 (Unix) (Red-Hat/Linux) PHP/4.0.5
X-Powered-By: PHP/4.0.5
Connection: close
Transfer-Encoding: chunked
Content-Type: text/plain
31
HTTP_RAW_POST_DATA is set, but it has zero length