def redirect(self, url, status=None):
        """
        Redirect to the specified url, optional status code defaults to 302.
        """
        self.status_code = 302 if status is None else status
        self.headers = Headers([('location', url)])
        self.message = ''
        self.end()
def redirect ( self , url , status = None ) : self . status_code = 302 if status is None else status self . headers = Headers ( [ ( 'location' , url ) ] ) self . message = '' self . end ( )
Redirect to the specified url, optional status code defaults to 302.