Bizarre problem with HTTP POST verb and HTTPServer on Win32
regkey at yahoo.com
Sun Sep 10 02:53:25 CEST 2000
Something very weird is happening; I have written a simple subclass of
HTTPRequestHandler which should handle HTTP GET and HTTP POST. It works
fine for HTTP GET but seems doesn't always respond to a POST on Win32.
If I create a form with method=POST and submit it then IE fails with
"connection reset by peer", curl (http://curl.haxx.nu) also fails. It
looks like a problem with whatever the equivalent of SIGPIPE is on Win32:
administrator$ curl -i -d a=b localhost:6543
administrator$ curl -v -i -d a=b localhost:6543
* Connected to John Smart (127.0.0.1)
> POST / HTTP/1.0
User-Agent: curl/7.2 (win32) libcurl 7.2.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
> Content-Length: 3
> Content-Type: application/x-www-form-urlencoded
The source is simply:
svr = BaseHTTPServer.HTTPServer(('', 6543), MyHTTPRequestHandler)
print "listing on port 6543"
Has anyone got any idea what is going on?
More information about the Python-list