Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text in HTTP headers

Tags:

http

header

Is there any rule against sending an alternate text for an HTTP response error? For example, a default is HTTP/1.1 400 Bad Request. When sending a header I set myself is it legal to do something like HTTP/1.1 400 Epic Fail?

like image 210
Alex S Avatar asked Jan 31 '26 10:01

Alex S


1 Answers

It's fine. You can put any text there. You can even use special characters as long as you stick to ISO-8859-1 encoding.

From the RFC:

The reason phrases listed here are only recommendations -- they MAY be replaced by local equivalents without affecting the protocol.

like image 139
Kornel Avatar answered Feb 03 '26 07:02

Kornel