Construct the response header.

        The return value is a list containing the whole response header, with
        each line as a list element.

def write(self):
        """Construct the response header.

        The return value is a list containing the whole response header, with
        each line as a list element.
        """

        slist = []
        slist.append('{}/{}.{} {} {}'.format(
                        self.protocol,
                        self.version[0],
                        self.version[1],
                        self.code,
                        status_messages[self.code]))
        slist.extend(self.write_headers())
        slist.append('\r\n')
        return slist