(self, keyword, value)
Send a MIME header to the headers buffer.
Send a MIME header to the headers buffer.
Send a MIME header to the headers buffer .
def send_header(self, keyword, value):
        """Send a MIME header to the headers buffer."""
        if self.request_version != 'HTTP/0.9':
            if not hasattr(self, '_headers_buffer'):
                self._headers_buffer = []
            self._headers_buffer.append(
                ("%s: %s\r\n" % (keyword, value)).encode('latin-1', 'strict'))

        if keyword.lower() == 'connection':
            if value.lower() == 'close':
                self.close_connection = True
            elif value.lower() == 'keep-alive':
                self.close_connection = False
def send_header ( self , keyword , value ) : if self . request_version != 'HTTP/0.9' : if not hasattr ( self , '_headers_buffer' ) : self . _headers_buffer = [ ] self . _headers_buffer . append ( ( "%s: %s\r\n" % ( keyword , value ) ) . encode ( 'latin-1' , 'strict' ) ) if keyword . lower ( ) == 'connection' : if value . lower ( ) == 'close' : self . close_connection = True elif value . lower ( ) == 'keep-alive' : self . close_connection = False