Say I'm sending some HTTP status code in PHP, do I actually need to do
header('HTTP/1.1 301 Moved Permanently');
or is it enough to
header('HTTP/1.1 301 FooBar');
I once did this in a quick and dirty reverse proxy, where I could only get the code, not the message, from a CURL response and sent it back with FooBar
as message. This appeared to work fine.
Via the spec:
The individual values of the numeric status codes defined for HTTP/1.1, and an example set of corresponding Reason-Phrase's, are presented below. The reason phrases listed here are only recommendations -- they MAY be replaced by local equivalents without affecting the protocol.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With