'Called by L{Request} objects to write a complete set of HTTP headers to
a transport.
@param version: The HTTP version in use.
@type version: L{bytes}
@param code: The HTTP status code to write.
@type code: L{bytes}
@param reason: The HTTP reason phrase to write.
@type reason: L{bytes}
@param headers: The headers to write to the transport.
@type headers: L{twisted.web.http_headers.Headers}'

def writeHeaders(self, version, code, reason, headers):

    responseLine = (((((version + '    ') + code) + '    ') + reason) + '\r\n')
    headerSequence = [responseLine]
    headerSequence.extend(((((name + ':    ') + value) + '\r\n') for (name, value) in headers))
    headerSequence.append('\r\n')
    self.transport.writeSequence(headerSequence)
