"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(); } ?>