Archived
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'){
|
||||
header('Content-Type: application/json');
|
||||
http_response_code($httpCode);
|
||||
echo json_encode($data, JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user