The set of commonly known HTTP status codes have an associated reason phrase
(see reasons). We don't provide a way to set the reason phrase because:
- it simplifies construction (users only supply the code)
- it avoids the need to validate user-defined reason phrases
- it omits the possibility of statuses with duplicate reason phrases
The only downside is that we lose the ability to create custom statuses with
"vanity" reason phrases, but this should be tolerable.
Represents an HTTP status code.
The set of commonly known HTTP status codes have an associated reason phrase (see
reasons
). We don't provide a way to set the reason phrase because:- it simplifies construction (users only supply the code) - it avoids the need to validate user-defined reason phrases - it omits the possibility of statuses with duplicate reason phrases
The only downside is that we lose the ability to create custom statuses with "vanity" reason phrases, but this should be tolerable.