'The real workhorse.'

def _start_transaction(self, conn, req):

    try:
        conn.putrequest(req.get_method(), req.get_selector(), skip_host=1, skip_accept_encoding=1)
        if (not req.has_header('Connection')):
            conn.putheader('Connection', 'keep-alive')
        data = req.get_data()
        if (data is not None):
            data = str(data)
            if (not req.has_header('Content-type')):
                conn.putheader('Content-type', 'application/x-www-form-urlencoded')
            if (not req.has_header('Content-length')):
                conn.putheader('Content-length', ('%d' % len(data)))
    except (socket.error, httplib.HTTPException):
        raise
    else:
        header_dict = dict(self.parent.addheaders)
        header_dict.update(req.headers)
        header_dict.update(req.unredirected_hdrs)
        for (k, v) in header_dict.iteritems():
            conn.putheader(to_utf8_raw(k), to_utf8_raw(v))
        conn.endheaders()
        if (data is not None):
            conn.send(data)
