Closed birdy247 closed 6 years ago
Seems, you are using JsendRenderer. Jsend by specification suppose to return always 200 response code.
@skie thanks, so what is the correct way to set the status to fail within an action?
You can switch to Json renderer or create custom renderer.
Hi @skie Thanks. We like JSend. I noticed there is a 200 response code with a status of fail. I was wondering if this could be configured from a action. https://labs.omniti.com/labs/jsend
Thanks
Like I said you should be able to overload Jsend class and add needed functionality.
I have tried setting the response code to something other than a 200.
What I tried:
In an Action
$response = $this->getService()->getResponse(); $this->getService()->setResponse($response->withStatus(404));
The response is still always a 200