api response content header as json
This commit is contained in:
parent
b036adf206
commit
0929870cc9
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user