mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
Deduplicate API GET check into single file
This commit is contained in:
8
api/v1/require_get_method.php
Normal file
8
api/v1/require_get_method.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
if($_SERVER['REQUEST_METHOD'] !== "GET"){
|
||||
header("HTTP/1.1 405 Method Not Allowed");
|
||||
$return_arr['success'] = "False";
|
||||
$return_arr['message'] = "Can only send GET requests to this endpoint.";
|
||||
echo json_encode($return_arr);
|
||||
exit();
|
||||
}
|
||||
Reference in New Issue
Block a user