'HTTP headers as a bytestring.'

def serialize_headers(self):

    headers = [(u'%s:    %s' % (key, value)).encode(u'us-ascii') for (key, value) in self._headers.values()]
    return '\r\n'.join(headers)
