diff options
Diffstat (limited to 'http/api.php')
-rw-r--r-- | http/api.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/http/api.php b/http/api.php index ab8d002..e83420b 100644 --- a/http/api.php +++ b/http/api.php @@ -193,11 +193,11 @@ function run($parameters) { } catch (ParametersException $e) { http_response_code(400); - die($e->getMessage()); + die(json_encode($e->getMessage())); } catch (Exception $e) { http_response_code(500); - die($e->getMessage()); + die(json_encode($e->getMessage())); } } @@ -205,6 +205,7 @@ function run($parameters) { http_response_code(405); die('API only accepts POST requests'); } else {*/ + header('Content-Type: application/json'); print(json_encode(run($_REQUEST))); //} |