<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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()