diff --git a/source/Jacwright/RestServer/RestServer.php b/source/Jacwright/RestServer/RestServer.php index 9e84b47..7357a99 100755 --- a/source/Jacwright/RestServer/RestServer.php +++ b/source/Jacwright/RestServer/RestServer.php @@ -151,9 +151,7 @@ public function handle() { } else { $result = call_user_func_array(array($obj, $method), $params); - if ($result !== null) { - $this->sendData($result); - } + $this->sendData($result); } } catch (RestException $e) { $this->handleError($e->getCode(), $e->getMessage()); @@ -483,7 +481,9 @@ public function sendData($data) { $this->corsHeaders(); } - if ($this->format == RestFormat::XML) { + if ($data === null) { + $this->setStatus(204); + } else if ($this->format == RestFormat::XML) { if (is_object($data) && method_exists($data, '__keepOut')) { $data = clone $data; foreach ($data->__keepOut() as $prop) {