To detect the PHP request type this is doing by using:
$_SERVER['REQUEST_METHOD']
For more details please see the documentation for the $_SERVER variable.