Closed thescientist13 closed 8 years ago
I don't think we need to add if it's not part of the RFC.
If you're talking about Slim 3 you can use:
$response = $response->withStatus(419, 'Authentication Timeout');
I'm actually on 2.8.2, is there a way with 2.x to do the same?
Not sure why you are setting the status code as the body, you need to set the status code as a status code.
$app->response->setStatus(419);
https://github.com/slimphp/Slim/blob/2.x/Slim/Http/Response.php#L156
I was working with Slim 2.8.2 and noticed that trying to set a 419 response
$slim->response->setBody(419);
would return a 200 to the client (in this case cURL via CLI).
Looking at the latest set of codes, 419 is not there https://github.com/slimphp/Slim/blob/3.x/Slim/Http/Response.php
Didn't see anything related in the open or closed issues list. Is this something I could submit a PR for? Understood it is not part of the RFC, but I have been seeing it used I would like to be able to support it.
Reference: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_Client_Error