Restful icon indicating copy to clipboard operation
Restful copied to clipboard

204 No Content

Open ondrej-tuhacek opened this issue 9 years ago • 1 comments

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).

ondrej-tuhacek avatar Jan 27 '16 10:01 ondrej-tuhacek

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.

jspetrak avatar Apr 14 '16 13:04 jspetrak