Download api/utils/Response.php from felix-fx/fx-1: direct link, hf CLI and curl.
- Browser
- Download file 554 Bytes
-
https://huggingface.co/felix-fx/fx-1/resolve/main/api/utils/Response.php
- Command line
-
hf download hf://felix-fx/fx-1/api/utils/Response.php
-
curl -L -o Response.php https://huggingface.co/felix-fx/fx-1/resolve/main/api/utils/Response.php
554 Bytes
| // /api/utils/Response.php | |
| class Response { | |
| public static function json($data, int $status = 200) { | |
| header('Content-Type: application/json'); | |
| http_response_code($status); | |
| echo json_encode($data); | |
| exit; | |
| } | |
| public static function error(string $message, int $status = 400) { | |
| self::json([ | |
| 'success' => false, | |
| 'error' => $message | |
| ], $status); | |
| } | |
| public static function success($data = []) { | |
| self::json(array_merge(['success' => true], $data)); | |
| } | |
| } | |