given the simplest HTTP server, how do I get post variables in a BaseHTTPRequestHandler?
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
class Handler(BaseHTTPRequestHandler):
def do_POST(self):
# post variables?!
server = HTTPServer(('', 4444), Handler)
server.serve_forever()
# test with:
# curl -d "param1=value1¶m2=value2" http://localhost:4444
I would simply like to able to get the values of param1 and param2. Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…