Files
Malawi-Stock-Exchange-API/check.php
Kwesi Banson Jnr 592a161ee6 Initial commit
2026-04-08 05:53:02 +00:00

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