Upload file with http client (multipart/form-data)
1 2 def post_multipart(host, selector, fields, files): 3 """ 4 Post fields and files to an http host as multipart/form-data. 5 fields is a sequence of (name, value) elements for regular form fields. 6 files is a sequence of (name, filename, value) elements for data to be uploaded as files 7 Return the server's response page. 8 """
See the rest of the implementation here