Im trying to do a http \'POST\' with multipart/form-data to a python GAE backend. My server side method is receiving the complete body but i have absolutely no idea how to p
You want the .cgi python library.
Specifically something like this:
import cgi
form = cgi.FieldStorage()
value1 = form.getfirst("value1", "")
value2 = form.getfirst("value2", "")
value3 = form.getfirst("value3", "")
logtext = form.getfirst("logText", "")
If you want the uploaded files, you can do this
for upload in self.get_uploads():
If you want just a text field:
x = self.request.get('value1')
For some reason cgi.FieldStorage() wasnt working for me, but only the deprecated method :
pdict = {'boundary':'*****'}
cgi.parse_multipart(self.request.body_file, pdict)
Dont know why but as long as its working im fine with that.