Code:
#!/usr/bin/env python
import os
import sys
print("Content-type: text/html")
print("")
print("<html>")
print("<body>")
print( "GET / POST Information")
print("<pre>")
print "Request method: " , os.environ[ 'REQUEST_METHOD' ]
print "Query string: " , os.environ[ 'QUERY_STRING' ]
count = 0
for line in sys.stdin:
count = count + 1
print line
if count > 100:
break
print ""
print("</pre>")
print("</body>")
print("</html>")
This will dump the information.
QUERY_STRING is mostly for GET (a POST can have a query string too)
sys.stdin gives you the data from the POST
You then have to parse the info, splitting first on '&' to separate the fields, then on '=' to make key-value pairs.
Then you would have to un-urlencode them too.
That is the low-level way to do it. I would assume there is a CGI module that would be easier to use.