code_junkie

retrieving XMLHttpRequest parameters in python

Nov 13th, 2011
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. <form> or <isindex>.
  2.  
  3. #! /usr/bin/python
  4.  
  5. import cgi
  6. from os import environ
  7. import cgitb
  8. cgitb.enable()
  9.  
  10. print "Content-type: text/plain"
  11. print
  12. print "REQUEST_METHOD:", environ["REQUEST_METHOD"]
  13. print "Values:"
  14. f = cgi.FieldStorage()
  15. for k in f.keys():
  16. print "%s: %s" % (k, f.getfirst(k))
Add Comment
Please, Sign In to add comment