18 lines
484 B
PHP
18 lines
484 B
PHP
<?php
|
|
|
|
if(strcasecmp($_SERVER['REQUEST_METHOD'], 'POST') != 0){
|
|
http_response_code(400);
|
|
echo json_encode(["status" => "fail", "message" => "Request method must be POST"]);
|
|
exit();
|
|
}
|
|
|
|
$contentType = isset($_SERVER["CONTENT_TYPE"]) ? trim($_SERVER["CONTENT_TYPE"]) : '';
|
|
|
|
if(strcasecmp($contentType, 'application/json') != 0){
|
|
http_response_code(400);
|
|
echo json_encode(["status" => "fail", "message" => "Content type must be: application/json"]);
|
|
exit();
|
|
}
|
|
|
|
?>
|