def post_multipart(self, url, params, files):
        #combine the parameters with the generated oauth params
        params = dict(params.items() + self.generate_oauth_params().items())
        faux_req = oauth.Request(method="POST", url=url, parameters=params)
        faux_req.sign_request(oauth.SignatureMethod_HMAC_SHA1(), self.consumer, self.token)
        params = dict(parse_qsl(faux_req.to_postdata()))

        content_type, body = self.encode_multipart_formdata(params, files)
        headers = {'Content-Type': content_type, 'Content-Length': str(len(body))}

        #Do a bytearray of the body and everything seems ok
        r = urllib2.Request(url, bytearray(body), headers)
        content = urllib2.urlopen(r).read()
        return self.json_parse(content)
Cancel not-yet-started jobs.
dataset/ETHPy150Open tumblr/pytumblr/pytumblr/request.py/TumblrRequest.post_multipart--crossover with--dataset/ETHPy150Open ganeti/ganeti/lib/client/gnt_job.py/CancelJobs