1
0
Fork 0
apt/mirror-failure.py
Daniel Baumann 6810ba718b
Adding upstream version 3.0.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-20 21:10:43 +02:00

23 lines
566 B
Python

# File: cgihttpserver-example-1.py
import CGIHTTPServer
import BaseHTTPServer
class Handler(CGIHTTPServer.CGIHTTPRequestHandler):
#cgi_directories = ["/cgi"]
def do_POST(self):
print "do_POST"
#print self.command
#print self.path
#print self.headers
print self.client_address
data = self.rfile.read(int(self.headers["content-length"]))
print data
self.wfile.write("200 Ok\n");
PORT = 8000
httpd = BaseHTTPServer.HTTPServer(("", PORT), Handler)
print "serving at port", PORT
httpd.serve_forever()