mirror of
https://git.steelants.cz/SH/PHP_SMART_HOME_V3.git
synced 2026-10-11 17:54:34 +00:00
api response content header as json
This commit is contained in:
1 parent
b036adf206
commit
0929870cc9
1 file changed
+1
@@ -30,6 +30,7 @@ class ApiController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function response($data = [], $httpCode = '200'){
|
protected function response($data = [], $httpCode = '200'){
|
||||||
|
header('Content-Type: application/json');
|
||||||
http_response_code($httpCode);
|
http_response_code($httpCode);
|
||||||
echo json_encode($data, JSON_UNESCAPED_UNICODE);
|
echo json_encode($data, JSON_UNESCAPED_UNICODE);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user