Skip to content

Instantly share code, notes, and snippets.

@josuebrunel
Created December 18, 2017 14:11
Show Gist options
  • Save josuebrunel/e3adb2e6f3e9561f20381e2df451d32f to your computer and use it in GitHub Desktop.
Save josuebrunel/e3adb2e6f3e9561f20381e2df451d32f to your computer and use it in GitHub Desktop.
import cgi
def parse_form_data(formdata):
fp = cgi.StringIO(formdata)
env = cgi.os.environ
env['REQUEST_METHOD'] = 'POST'
data = cgi.FieldStorage(fp, environ=env)
return data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment