Restful
Restful copied to clipboard
204 No Content
Is it somehow possible not to sending HTTP 204 No content header when an empty array is passed into $this->resource
? I would like to have output like []
in JSON (We use Kendo UI and these components expect empty JSON collection when nothing is filtered out in autocomplete input).
I've just hit the same problem. Though both HTTP 200 OK + []
and HTTP 204 No Content responses are valid, the later provides benefit of having single if-else check in the client code and iteration of result regardles of number of items returned.