#!"C:Program Files (x86)Amppspythonpython.exe"
import os,sys,cgi
print "Content-Type: text/plain;charset=utf-8"
form = cgi.FieldStorage()
json = form.getvalue("json")
file = open("testjson.json", "w")
file.write(json)
file.close()
print json
sys.exit()
Estou executando o Python 2.7.2 como WSGI e outros scripts parecem funcionar.
Respostas:
1 para resposta № 1O último cabeçalho HTTP deve ser seguido por uma linha em branco. (O cabeçalho e o corpo devem ser separados por linha em branco)
print "Content-Type: text/plain;charset=utf-8"
print # <---- Add this line
...
# sys.exit() <--- This is not needed.