private function isAjax(ServerRequestInterface $request): bool
    {
        $params = $request->getServerParams();

        if (! array_key_exists('HTTP_X_REQUESTED_WITH', $params)) {

            return false;

        }

        return strtolower($params['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest';
    }