src/request.php
public static function get_method() {
	if (empty($_SERVER['REQUEST_METHOD'])) {
		return 'GET';
	}
	
	$allowed_methods = ['GET', 'PUT', 'POST', 'PATCH', 'DELETE', 'OPTIONS', 'HEAD'];
	if (in_array($_SERVER['REQUEST_METHOD'], $allowed_methods) == false) {
		return false;
	}
	
	return $_SERVER['REQUEST_METHOD'];
}
public static function get_method() {
	if (empty($_SERVER['REQUEST_METHOD'])) {
		return 'GET';
	}
	
	$allowed_methods = ['GET', 'PUT', 'POST', 'PATCH', 'DELETE', 'OPTIONS', 'HEAD'];
	if (in_array($_SERVER['REQUEST_METHOD'], $allowed_methods) == false) {
		return false;
	}
	
	return $_SERVER['REQUEST_METHOD'];
}
public static function get_method ( ) { if ( empty ( $ _SERVER [ 'REQUEST_METHOD' ] ) ) { return 'GET' ; } $ allowed_methods = [ 'GET' , 'PUT' , 'POST' , 'PATCH' , 'DELETE' , 'OPTIONS' , 'HEAD' ] ; if ( in_array ( $ _SERVER [ 'REQUEST_METHOD' ] , $ allowed_methods ) == false ) { return false ; } return $ _SERVER [ 'REQUEST_METHOD' ] ; }
get the http method used for the current session

@return string|boolean one of GET|PUT|POST|PATCH|DELETE|OPTIONS|HEAD
or false for unknown types
get the http method used for the current session