def start_response(self, status, headers, exc_info = None):
        """WSGI callable to begin the HTTP response."""
        # "The application may call start_response more than once,
        # if and only if the exc_info argument is provided."
        if self.started_response and not exc_info:
            raise AssertionError("WSGI start_response called a second "
                                 "time with no exc_info.")
        self.started_response = True
        
        # "if exc_info is provided, and the HTTP headers have already been
        # sent, start_response must raise an error, and should raise the
        # exc_info tuple."
        if self.req.sent_headers:
            try:
                raise exc_info[0], exc_info[1], exc_info[2]
            finally:
                exc_info = None
        
        self.req.status = status
        for k, v in headers:
            if not isinstance(k, str):
                raise TypeError("WSGI response header key %r is not a byte string." % k)
            if not isinstance(v, str):
                raise TypeError("WSGI response header value %r is not a byte string." % v)
        self.req.outheaders.extend(headers)
        
        return self.write
def start_response ( self , status , headers , exc_info = None ) : if self . started_response and not exc_info : raise AssertionError ( "WSGI start_response called a second " "time with no exc_info." ) self . started_response = True if self . req . sent_headers : try : raise exc_info [ 0 ] , exc_info [ 1 ] , exc_info [ 2 ] finally : exc_info = None self . req . status = status for k , v in headers : if not isinstance ( k , str ) : raise TypeError ( "WSGI response header key %r is not a byte string." % k ) if not isinstance ( v , str ) : raise TypeError ( "WSGI response header value %r is not a byte string." % v ) self . req . outheaders . extend ( headers ) return self . write
WSGI callable to begin the HTTP response.