Closed Raistlfiren closed 7 years ago
We already have this baked in.
https://github.com/slimphp/Slim/blob/3.x/Slim/Http/Response.php#L48-L118
I don't see the problem it solves. If you don't know the status code you wish to use then you need to know the name it uses... which often times is not really a name that you think of... example 418 => 'I\'m a teapot',
To me, error codes are more clear than the titles of the errors. So no, it will only make things worse.
I'm not against it. I would use STATUS_XYZ
rather than HTTP_XYZ
personally, though.
@akrabat Nothing can really be done on 3.x... but this should be raised on slimphp/http
Going to close this here, it's open on Http and we can change the constants in 4.x
Hey,
I just wanted to bring up a discussion for later releases on adding the status codes as constants to the Response class. Similarly to http://api.symfony.com/3.4/Symfony/Component/HttpFoundation/Response.html
I feel like it is much more beneficial coding using constants instead of status code of say
422
or400
. For example, users can now use the constants in their code like Response::HTTP_UNPROCESSABLE_ENTITY or Response::HTTP_BAD_REQUEST.Thoughts?
Thanks for your time and consideration.