I just need to write a simple python CGI script to parse the contents of a POST request containing JSON. This is only test code so that I can test a client application until th
notice that if you call cgi.FieldStorage() before in your code, you can't get the body data from stdin, because it just be read once.
cgi.FieldStorage()
If you're using CGI, just read data from stdin:
stdin
import sys data = sys.stdin.read()