I know that 204 means that the server has understood the request but there is no content available. But I think is wrong prevent to the developer return a json message like this: return json_encode(array("mex" => "no content"));
What I need is return also a json when the API return 204 in the header. I don't want use 200 in this case 'cause this means that there is a content returned.
Also the 404 is not appropriate 'cause this means the resource doesn't exits.
Anyidea to do this?
This is my code:
http_response_code(204);
return json_encode(array("mex" => "no content"));