views:

118

answers:

2

There're many ways to write an HTTP-status header:

HTTP/1.1 404 Not Found
Status: 404
Status: 404 Not Found

but which is the semantically-correct and spec-compliant way?

Edit: By status headers I mean this, using a function such as PHP's header().

+1  A: 

A lot of them are pretty much arbitrary strings, but there here is the w3c's spec for the commonly used ones

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

Jason Watts
A: 

The closest thing I've found to an answer is the Fast CGI spec, which states to set status codes through Status and Location headers.

orlandu63