api response content header as json

This commit is contained in:
xinatorus 2020-05-22 20:11:52 +02:00
parent b036adf206
commit 0929870cc9
1 changed files with 1 additions and 0 deletions

View File

@ -30,6 +30,7 @@ class ApiController {
}
protected function response($data = [], $httpCode = '200'){
header('Content-Type: application/json');
http_response_code($httpCode);
echo json_encode($data, JSON_UNESCAPED_UNICODE);
}