Python standard library to POST multipart/form-data encoded data

hoju picture hoju · Aug 13, 2009 · Viewed 15.3k times · Source

I would like to POST multipart/form-data encoded data. I have found an external module that does it: http://atlee.ca/software/poster/index.html however I would rather avoid this dependency. Is there a way to do this using the standard libraries?

thanks

Answer

Martin v. Löwis picture Martin v. Löwis · Aug 13, 2009

The standard library does not currently support that. There is cookbook recipe that includes a fairly short piece of code that you just may want to copy, though, along with long discussions of alternatives.