File: mirror-failure.py

package info (click to toggle)
apt 1.0.9.8.4
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 15,080 kB
  • ctags: 5,307
  • sloc: cpp: 50,972; sh: 12,111; xml: 4,130; makefile: 855; perl: 209; python: 28
file content (23 lines) | stat: -rw-r--r-- 566 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 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()