Better function isPost

Use $_SERVER['REQUEST_METHOD'] instead of empty($_POST)
Possibly related to #413