Headers - returning specified HTTP headers from a POST
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Headers - returning specified HTTP headers from a POST

From: John Smith <johnsmith@theweather.com.au>
Date: Thu Aug 11 2005 - 03:56:07 CEST

I'm writing a service which accepts a POST call, updates a database and
returns raw HTTP headers as specified below:

HTTP/1.1 200 OK
Content-type:text/plain
Content-length:3

OK

The code runs, and returns my headers, but only after its own:

HTTP/1.1 100 Continue
Server: Microsoft-IIS/5.1
Date: Wed, 10 Aug 2005 21:45:58 GMT

HTTP/1.1 200 OK
Server: Microsoft-IIS/5.1
Date: Wed, 10 Aug 2005 21:45:58 GMT
Connection: close
Content-type:text/plain
Content-length:3

OK

Here's some static code which replicates the problem:

<?php
header( "HTTP/1.1 200 OK\r\n" );
header( "Content-type:text/plain\r\n" );
header( "Content-length:3\r\n" );
header( "\r\n" );
header( "OK \n" );
exit;
?>

The platform is IIS 5.1 (obviously) and we're using PHP 4.3.10.

If it can't be solved in PHP but can in Perl, ASP or some other language,
please let me know. Likewise if it can be solved on Apache/Linux/PHP 5. I
really didn't expect this to be a problem.

Thanks in advance. Did I mention that this is urgent?

Iain
Received on Mon Oct 24 02:09:21 2005