public function withRedirect($url, $status = null)
        {
            $response = $this->withHeader('Location', (string)$url);
            if (is_null($status) && $this->getStatusCode() === 200) {
                $status = 302;
            }
            if (!is_null($status)) {
                return $response->withStatus($status);
            }
            return $response;
        }