'Return a tuple (url, data, headers).'

def _request_data(self):

    method = self.method.upper()
    parts = self._urlparse(self.action)
    (rest, (query, frag)) = (parts[:(-2)], parts[(-2):])
    if (method == 'GET'):
        self.enctype = 'application/x-www-form-urlencoded'
        parts = (rest + (urlencode(self._pairs()), None))
        uri = self._urlunparse(parts)
        return (uri, None, [])
    elif (method == 'POST'):
        parts = (rest + (query, None))
        uri = self._urlunparse(parts)
        if (self.enctype == 'application/x-www-form-urlencoded'):
            return (uri, urlencode(self._pairs()), [('Content-Type', self.enctype)])
        elif (self.enctype == 'text/plain'):
            return (uri, self._pairs(), [('Content-Type', self.enctype)])
        elif (self.enctype == 'multipart/form-data'):
            data = StringIO()
            http_hdrs = []
            mw = MimeWriter(data, http_hdrs)
            f = mw.startmultipartbody('form-data', add_to_http_hdrs=True, prefix=0)
            for (ii, k, v, control_index) in self._pairs_and_controls():
                self.controls[control_index]._write_mime_data(mw, k, v)
            mw.lastpart()
            return (uri, data.getvalue(), http_hdrs)
        else:
            raise ValueError(("unknown    POST    form    encoding    type    '%s'" % self.enctype))
    else:
        raise ValueError(("Unknown    method    '%s'" % method))
