diff --git a/src/Outputrest.php b/src/Outputrest.php index 6f7d473..a88d764 100644 --- a/src/Outputrest.php +++ b/src/Outputrest.php @@ -32,9 +32,10 @@ class Outputrest extends Output $layout = FALSE, $replacement = array(), $variable = array (), $module = "") { - if (! isset ($variable["exceptionCode"])) - $variable["exceptionCode"] = 200; + $code = http_response_code(); + if (isset ($variable["exceptionCode"])) + $code = $variable["exceptionCode"]; $rest = new Rest (); - $rest->display ($data, $variable["exceptionCode"]); + $rest->display ($data, $code); } }