diff --git a/appexemplo_v2.0/api/api_controllers/TGenericAPI.class.php b/appexemplo_v2.0/api/api_controllers/TGenericAPI.class.php index f77bb48f..20ca742f 100644 --- a/appexemplo_v2.0/api/api_controllers/TGenericAPI.class.php +++ b/appexemplo_v2.0/api/api_controllers/TGenericAPI.class.php @@ -10,9 +10,11 @@ public function __construct() { } - public static function getBodyJson($msg, Response $response) + public static function getBodyJson($msg, Response $response,$status=200) { + $status = empty($status)?200:$status; $msgJson = json_encode($msg); + $response->withStatus( $status ); $response->getBody()->write( $msgJson ); return $response->withHeader('Content-Type', 'application/json'); }