question about posting data using MultipartPostHandler

cerr ron.eggler at gmail.com
Thu Aug 15 14:12:58 EDT 2013


Hi,

I want to use http post to upload data to a webserver but I want to pass multiple arguments within the post i.e.
I know that you can load one item (data)in there like this:
			data = {"data":open(filename,"rb")}
			response = opener.open(url, data, timeout=TIMEOUT)
but now I want multiple so I tried this:
        multipart = ({"data":data}, {"fname":fname}, {"f":f})
        response = opener.open(url, multipart, timeout=TIMEOUT)

but I get an error saying "'tuple' object has no attribute 'items'"... how do I do this correctly?

Thank you!
Ron



More information about the Python-list mailing list