Jacwright\RestServer\RestServer::getMethod PHP Method

getMethod() public method

public getMethod ( )
    public function getMethod()
    {
        $method = $_SERVER['REQUEST_METHOD'];
        $override = isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']) ? $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] : (isset($_GET['method']) ? $_GET['method'] : '');
        if ($method == 'POST' && strtoupper($override) == 'PUT') {
            $method = 'PUT';
        } elseif ($method == 'POST' && strtoupper($override) == 'DELETE') {
            $method = 'DELETE';
        } elseif ($method == 'POST' && strtoupper($override) == 'PATCH') {
            $method = 'PATCH';
        }
        return $method;
    }