Re: POST on redirects?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Adam Zey wrote:
> function make_post($message)
> {
>     $headers .= "POST /foo.php HTTP/1.1\r\n";
>     $headers .= "Host: bar.com\r\n";
>     $headers .= "Content-Type: application/octet-stream\r\n";
>     $headers .= "Connection: keep-alive\r\n";
>     $headers .= "Content-Length: " . strlen($message) . "\r\n";
>     $headers .= "\r\n";
>     return $headers . $message;
> }
> 
> As far as I can tell, these are the absolute minimum set of
> headers you can get away with for a POST transaction (If you
> know how to use less, let me know, I use this in a situation
> where overhead matters).

Your Connection header is redundant, since that's the default value in
HTTP/1.1.

I would send the header but give it a value of close, since I see no
good reason to leave the TCP connection open until it times out. That's
a pretty big waste in a situation where overhead matters.

Hope that helps.

Chris

-- 
Chris Shiflett
Principal, OmniTI
http://omniti.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux