Print environ.cgi: Difference between revisions

From XPUB & Lens-Based wiki
(New page: Python's cgi module has a built in function to "dump" the entire environment of an HTTP request. Quite useful for debugging. <source lang="python"> import cgi fs = cgi.FieldStorage() pri...)
 
No edit summary
 
Line 7: Line 7:
print "Content-type: text/html"
print "Content-type: text/html"
print
print
fs.print_environ()
fs.print_environ()
</source>
</source>

Latest revision as of 18:10, 19 January 2009

Python's cgi module has a built in function to "dump" the entire environment of an HTTP request. Quite useful for debugging.

import cgi
fs = cgi.FieldStorage()

print "Content-type: text/html"
print

fs.print_environ()